Q_Id
int64
2.93k
49.7M
CreationDate
stringlengths
23
23
Users Score
int64
-10
437
Other
int64
0
1
Python Basics and Environment
int64
0
1
System Administration and DevOps
int64
0
1
DISCREPANCY
int64
0
1
Tags
stringlengths
6
90
ERRORS
int64
0
1
A_Id
int64
2.98k
72.5M
API_CHANGE
int64
0
1
AnswerCount
int64
1
42
REVIEW
int64
0
1
is_accepted
bool
2 classes
Web Development
int64
0
1
GUI and Desktop Applications
int64
0
1
Answer
stringlengths
15
5.1k
Available Count
int64
1
17
Q_Score
int64
0
3.67k
Data Science and Machine Learning
int64
0
1
DOCUMENTATION
int64
0
1
Question
stringlengths
25
6.53k
Title
stringlengths
11
148
CONCEPTUAL
int64
0
1
Score
float64
-1
1.2
API_USAGE
int64
1
1
Database and SQL
int64
0
1
Networking and APIs
int64
0
1
ViewCount
int64
15
3.72M
4,995,336
2011-02-14T17:40:00.000
0
1
1
0
0
python,embed,python-c-api
1
4,995,435
0
1
0
true
0
1
You need the encodings/__init__.py file, otherwise encodings is a folder and not a python package. Chances are that you'll need a lot of stuff from within the python standard library. To make everything just work you'll need to include the entire standard library along with your program. You can make this a bit better ...
1
2
0
0
I'm trying to make a small game that supports Python scripting. I've no problems with using the Python C-API, but I don't know how to ensure that the game will run on a computer with no Python installed. I know I need pythonXY.dll -- what else is there? When I try to run the program it tells me it cannot find encodings...
C++ Python embedding: Run on machine with no Python?
0
1.2
1
0
0
258
4,999,078
2011-02-15T01:20:00.000
2
0
1
0
0
python,json,pyjamas
0
5,659,587
0
1
0
true
0
0
I've played with pyjamas a little and am currently implementing json-rpc with django. Have you considered using ssl to secure the site. Short of implementing your own (basic) encryption routine, its probably the best way forward.
1
2
0
0
What's the simplest way to set up a JSON-RPC server in python and make it secure? I'm very interested Pyjamas for python/javascript - but the documentation doesn't explain how to implement security with the JSON-RPC.
Easy secure JSON-RPC in python
0
1.2
1
0
0
934
5,002,986
2011-02-15T11:22:00.000
0
1
0
0
1
python,automated-tests,web-scraping,urllib2,mechanize-python
0
5,462,848
0
3
0
true
1
0
I actually went without using mechanize and used the Threading module. This allowed for fairly quick transactions, and I also made sure not to have too much inside of each thread. Login information, and getting the webapp in the state necessary before I threaded helped the threads to run shorter and therefore more quic...
2
2
0
0
I have a web app that needs both functionality and performance tested, and part of the test suite that we plan on using is already written in Python. When I first wrote this, I used mechanize as my means of web-scraping, but it seems to be too bulky for what I'm trying to do (either that or I'm missing something). The ...
Python web-scraping threaded performance
0
1.2
1
0
0
929
5,002,986
2011-02-15T11:22:00.000
0
1
0
0
1
python,automated-tests,web-scraping,urllib2,mechanize-python
0
5,236,735
0
3
0
false
1
0
Have you considered Twisted, the asynchronous library, for at least doing interaction with users?
2
2
0
0
I have a web app that needs both functionality and performance tested, and part of the test suite that we plan on using is already written in Python. When I first wrote this, I used mechanize as my means of web-scraping, but it seems to be too bulky for what I'm trying to do (either that or I'm missing something). The ...
Python web-scraping threaded performance
0
0
1
0
0
929
5,006,424
2011-02-15T16:30:00.000
0
0
1
0
0
python,nltk
0
5,009,683
0
2
0
false
0
0
Where's the input paragraph coming from? File? Console? That's more of a python issue than NLTK. For the rest, look at the nltk.tokenize module & nltk.probability.FreqDist.
1
2
0
0
I have just started using Natural Language Toolkit (NLTK) as a part of my Engineering college project. Can anybody please tell me how do I read an input paragraph text and 1) break it down into textual components i.e into number of sentences, number of words, number of characters and number of polysyllabic or complex w...
How do I find text features and print them?
0
0
1
0
0
255
5,009,112
2011-02-15T20:26:00.000
0
0
0
0
0
python,sqlalchemy,nosetests
0
10,268,378
0
1
0
false
0
0
It is my understanding that this plugin is only meant for unit testing SQLAlchemy itself and not as a general tool. Perhaps that is why there are no examples or documentation? Posting to the SQLAlchemy mailing list is likely to give you a better answer "straight from the horse's mouth".
1
3
0
0
The python unit testing framework called nosetest has a plugin for sqlalchemy, however there is no documentation for it that I can find. I'd like to know how it works, and if possible, see a code example.
How does the nosetests sqlalchemy plugin work?
1
0
1
1
0
340
5,011,135
2011-02-16T00:25:00.000
1
1
0
1
0
python,tornado
0
12,342,342
0
5
0
true
0
0
Use Django. I'm a hardcore Tornado fan but if you need to ask, Django is the best tool for you. Tornado is great but Django is much easier to build when you need a MySQL database thanks to its awesome ORM.
4
5
0
0
I want to use a Python framework that handles sessions (user auth), templating along with MySQL database access (although I can use MySQLdb quite nicely) Tornado looks promising but, I just can't see how to use it. The sample given has a port listen feature. Does it replace Apache? Exactly how do I configure my server ...
python tornado setup
0
1.2
1
0
0
4,348
5,011,135
2011-02-16T00:25:00.000
0
1
0
1
0
python,tornado
0
31,242,703
0
5
0
false
0
0
If you are using tornado follow nginx.
4
5
0
0
I want to use a Python framework that handles sessions (user auth), templating along with MySQL database access (although I can use MySQLdb quite nicely) Tornado looks promising but, I just can't see how to use it. The sample given has a port listen feature. Does it replace Apache? Exactly how do I configure my server ...
python tornado setup
0
0
1
0
0
4,348
5,011,135
2011-02-16T00:25:00.000
1
1
0
1
0
python,tornado
0
8,414,532
0
5
0
false
0
0
if you using tornado for websockets you can use ha-proxy for proxying socket request to tornado (ngnix not support this)
4
5
0
0
I want to use a Python framework that handles sessions (user auth), templating along with MySQL database access (although I can use MySQLdb quite nicely) Tornado looks promising but, I just can't see how to use it. The sample given has a port listen feature. Does it replace Apache? Exactly how do I configure my server ...
python tornado setup
0
0.039979
1
0
0
4,348
5,011,135
2011-02-16T00:25:00.000
0
1
0
1
0
python,tornado
0
7,278,376
0
5
0
false
0
0
If you setup tornado via LAMP (apache with mod_wsgi for example) you will lose every single async option in tornado, significant amount of memory and speed. It's highly recomended to use nginx for serving static files and proxying dynamic requests to the tornado application instance.
4
5
0
0
I want to use a Python framework that handles sessions (user auth), templating along with MySQL database access (although I can use MySQLdb quite nicely) Tornado looks promising but, I just can't see how to use it. The sample given has a port listen feature. Does it replace Apache? Exactly how do I configure my server ...
python tornado setup
0
0
1
0
0
4,348
5,012,257
2011-02-16T03:31:00.000
1
0
0
0
0
python,wxpython,boxsizer
0
5,018,264
0
1
0
false
0
1
For complex layouts, I sketch it out on a piece of paper. Then I draw boxes around the widgets in different ways to decide what sizers to use. You can nest pretty much any sizer inside another one. If the controls naturally fit in a grid, then using a grid sizer of some sort is probably alright. If not, then use BoxSiz...
1
1
0
0
I have a wxPython app with one frame and one panel. On that panel are a number of static boxes, each of which has buttons and textboxes. I have just begun reading about sizers, but they seem like they might be more than what I need, or it could that they are exactly what I need but I don't know how to use them correct...
Simple wxPython Frame Contents Resizing - Ratio?
0
0.197375
1
0
0
301
5,012,560
2011-02-16T04:32:00.000
2
0
1
0
0
python,random,seed
0
5,012,654
0
7
1
false
0
0
The seed is an internal variable in the random package which is used to create the next random number. When a new number is requested, the seed is updated, too. I would simple use 0 as a seed if you want to be sure to have the same random numbers every time, or make i configurable. CorelDraw once had a random pattern...
1
59
0
0
Is there any way to find out what seed Python used to seed its random number generator? I know I can specify my own seed, but I'm quite happy with Python managing it. But, I do want to know what seed it used, so that if I like the results I'm getting in a particular run, I could reproduce that run later. If I had the...
how to query seed used by random.random()?
0
0.057081
1
0
0
41,980
5,014,993
2011-02-16T10:02:00.000
0
0
0
0
0
python,scroll,zooming,transform,pygame
0
13,349,846
0
3
0
false
0
1
For a game that I have never finished I used trigonometry to get the new drawing positions with a freely zoomed and turned camera (bit complicated). It didn't really take to much time to calculate but I think it is more efficient to use other libraries. But if you want some examples just ask.
2
5
0
0
Im currently working on a project with pygame and am in need of being able to view part of a surface, moving around, zooming in and out ect Can anyone recommend a way of achieving this efficently, i have it working in a convoluted method at the moment but it is too slow and reduces the game to about 1fps when zoomed ou...
Pygame zooming/scrolling window
0
0
1
0
0
7,328
5,014,993
2011-02-16T10:02:00.000
0
0
0
0
0
python,scroll,zooming,transform,pygame
0
7,509,780
0
3
0
false
0
1
You can use pygame with OpenGL, since you are already familiar with pygame. Otherwise pyglet is a similar opengl library.
2
5
0
0
Im currently working on a project with pygame and am in need of being able to view part of a surface, moving around, zooming in and out ect Can anyone recommend a way of achieving this efficently, i have it working in a convoluted method at the moment but it is too slow and reduces the game to about 1fps when zoomed ou...
Pygame zooming/scrolling window
0
0
1
0
0
7,328
5,021,921
2011-02-16T20:48:00.000
3
0
0
0
0
python,numpy,scipy,data-fitting
0
5,022,089
0
4
0
false
0
0
Except, a spline does not give you a "formula", at least not unless you have the wherewithal to deal with all of the piecewise segments. Even then, it will not be easily written down, or give you anything that is at all pretty to look at. A simple spline gives you an interpolant. Worse, for 3000 points, an interpolatin...
2
1
1
0
I am looking for a "method" to get a formula, formula which comes from fitting a set of data (3000 point). I was using Legendre polynomial, but for > 20 points it gives not exact values. I can write chi2 test, but algorithm needs a loot of time to calculate N parameters, and at the beginning I don't know how the functi...
large set of data, interpolation
0
0.148885
1
0
0
2,988
5,021,921
2011-02-16T20:48:00.000
0
0
0
0
0
python,numpy,scipy,data-fitting
0
5,022,008
0
4
0
false
0
0
The only formula would be a polynomial of order 3000. How good does the fit need to be? What type of formula do you expect?
2
1
1
0
I am looking for a "method" to get a formula, formula which comes from fitting a set of data (3000 point). I was using Legendre polynomial, but for > 20 points it gives not exact values. I can write chi2 test, but algorithm needs a loot of time to calculate N parameters, and at the beginning I don't know how the functi...
large set of data, interpolation
0
0
1
0
0
2,988
5,022,891
2011-02-16T22:25:00.000
1
0
0
0
1
python,python-imaging-library,cairo
0
5,024,687
0
2
0
true
0
1
You can do this entirely with PIL if you start with a single pre-made white-to-black gradient image (that you've made in some other program) and then use the ImageChops module to manipulate this together with your primary image to get what you want. For example to if you want to fade from red to blue: multiply red by t...
1
1
0
0
I am trying automatically generate buttons to a menu using PIL in python. The button should be small rectangular and have a little gradient from one color to another, and a little text in it. Is PIL the best way to do this, or is Cairo a better alternative? Any suggestion to how I can accomplish this without having a i...
Generating a shaded button using PIL
0
1.2
1
0
0
413
5,028,075
2011-02-17T11:02:00.000
1
0
0
1
0
python,installation,distutils
0
7,715,650
0
2
0
false
0
0
For distutils, we are working on support to install scripts into prefix/sbin.
1
5
0
0
Commonly on most unix systems there is a distinction between $PREFIX/bin and $PREFIX/sbin. When installing a piece of software the administrator decides about what $PREFIX is, but the author decides which programs are suitable for regular users and which are not. With Python's distutils a set of scripts can be defined ...
How to install scripts to sbin with python's distutils?
0
0.099668
1
0
0
2,055
5,030,586
2011-02-17T14:58:00.000
1
0
0
1
0
python,winforms,global-variables
0
5,031,228
0
2
0
true
0
0
Easiest solution is probably to just have the python script print to stdout: say each time an item is processed, print a line with a number representing how many items have been processed (or a percentage). Then have the forms application read the output line by line, updating the progressbar based on that information.
1
3
0
0
I am trying to figure out an elegant way to share a variable between a windows form app and a python script running in the background. The variable would be used solely to update a progress bar in the windows form based on the the long running process in the python script. More specifically, a windows timer will fire...
Elegant Way To Share Variable Between Windows Form and Python Script Running In Background Process
1
1.2
1
0
0
580
5,048,515
2011-02-19T02:49:00.000
1
0
1
0
0
python,process
0
5,048,580
0
2
0
false
0
0
You need to communicate using a shared resource. In the simplest sense, you use the resource as a mutex. Lock or pid files are commonly used this way on *nix by using the filesystem as that shared resource. Depending on need, you can use a shared resource that allows communication; e.g. a web browser executed to open...
1
5
0
0
I need to add a function to my python script that checks if the current script is already running. If it is then it will quit, if not it continues running the script. I've looked into methods of doing this but I cant figure out how to do it.
Check if current process is running using Python?
0
0.099668
1
0
0
5,538
5,050,817
2011-02-19T12:40:00.000
0
0
0
0
1
python,qt4,pyqt,pyqt4,qlistwidget
0
18,070,801
0
2
0
false
0
1
More than likely this functionality exists because the multitouch event is being interpreted by your operating system as a scroll of some type and QT is recieving the scroll action, rather than the multitouch action directly.
1
3
0
0
I'm having a problem with a simple Notepad application I'm writing to teach myself basic Python/PyQt. Specifically, I want to know how to change the multi-touch pan gesture sensitivity on a QListWidget. As it is now, when I drag up and down with 2 fingers, it seems like the list is moving up/down one step for each pix...
Customize PyQt multi-touch pan gestures on QListWidget
0
0
1
0
0
1,586
5,058,333
2011-02-20T16:30:00.000
1
0
0
0
0
python,google-app-engine
0
17,245,724
0
2
0
false
1
0
If you are presenting the survey question in a browser, I would definitely go with one model (in one datastore as noted by Peter) having questions and answers properties. Serialize the questions and answers into two TextProperties (be sure to escape them first). From this point, everything can be done inside Javascript...
1
0
0
0
Hey I am trying to create a survey that asks the users to create his own question and list 5 multiple choices. My first sense is that I create two datastores and one to store the user quesiton and one to to store 5 choices mapping to the question just created. but i dont know how exactly I should do with the 5 multipl...
how to create a survey that has 5 multiple choices
0
0.099668
1
0
0
2,507
5,059,567
2011-02-20T19:49:00.000
1
0
1
0
1
documentation,python-3.x,documentation-generation
1
5,059,933
0
1
0
true
0
0
Apparently in Jinja, something is doing X.next(). In Python 3 that's next(x) instead. It should be a simple fix.
1
3
0
1
I recently felt the urge to generate documentation for my little project. I thought it would be fairly easy since I had a set of nice docstrings. Turns out the whole process is much more complicated in python 3.1. Here's what I tried: epydoc: Fails because it's for python 2. 2to3 didn't solve the problems pydoc: I ca...
Documentation generator for python3
0
1.2
1
0
0
872
5,059,883
2011-02-20T20:43:00.000
2
0
0
0
0
python,mysql,django
0
5,412,380
0
1
0
true
1
0
I found that the key was actually generated under HKEY_CURRENT_USER instead of HKEY_LOCAL_MACHINE. Thanks.
1
5
0
0
I am trying to MySQL for Python (MySQLdb package) in Windows so that I can use it in the Django web frame. I have just installed MySQL Community Server 5.5.9 and I have managed to run it and test it using the testing procedures suggested in the MySQL 5.5 Reference Manual. However, I discovered that I still don't have t...
MySQL AB, MySQL Server 5.5 Folder in HKEY_LOCAL_MACHINE not present
0
1.2
1
1
0
854
5,063,658
2011-02-21T08:17:00.000
1
0
0
0
0
python,database,django,django-models,coding-style
0
5,064,564
0
2
0
true
1
0
I recommend extending Django's Model-Template-View approach with a controller. I usually have a controller.py within my apps which is the only interface to the data sources. So in your above case I'd have something like get_all_parties_and_people_for_user(user). This is especially useful when your "data taken from seve...
2
3
0
0
I'm creating a small website with Django, and I need to calculate statistics with data taken from several tables in the database. For example (nothing to do with my actual models), for a given user, let's say I want all birthday parties he has attended, and people he spoke with in said parties. For this, I would need a...
Correct way of implementing database-wide functionality
0
1.2
1
1
0
110
5,063,658
2011-02-21T08:17:00.000
0
0
0
0
0
python,database,django,django-models,coding-style
0
5,065,280
0
2
0
false
1
0
User.get_attended_birthday_parties() or Event.get_attended_parties(user) work fine: it's an interface that makes sense when you use it. Creating an additional "all-purpose" object will not make your code cleaner or easier to maintain.
2
3
0
0
I'm creating a small website with Django, and I need to calculate statistics with data taken from several tables in the database. For example (nothing to do with my actual models), for a given user, let's say I want all birthday parties he has attended, and people he spoke with in said parties. For this, I would need a...
Correct way of implementing database-wide functionality
0
0
1
1
0
110
5,066,530
2011-02-21T13:28:00.000
1
1
0
1
0
python,project,upgrade,pylons
1
5,067,114
0
1
0
false
1
0
might be obvious but did you run "python setup.py develop" on the application package so that the dependencies could be installed?
1
2
0
0
I have an old project, it written under Python 2.5/2.6, Windows. We had Python 2.6/Win7/x64 now, and I tried to start it. I got the old project that running nondebug mode in a server, and copied into local folder. When I tried to yesterday start it, I got this error: 15:44:58,038 DEBUG [pylons.configuration] Loade...
Pylons - how to use an old project in a new environment?
1
0.197375
1
0
0
68
5,074,537
2011-02-22T05:52:00.000
1
0
0
0
0
python,django,django-authentication,django-apps
0
5,085,483
0
1
0
true
1
0
There shouldn`t be any problems there. Django-Socialauth adda new auth backends, and it should works fine with permissions and decorators. And Django resistration just register a user on site, so unless you remove standard auth backend, it will work fine too.
1
0
0
0
Have anyone used these 2 django apps together? I want to know how well these 2 gel together along with Django's User Authentication system. When I mean Django's User Authentication System, I mean I should be able to use decorators like @login_required or grant permission to specific views (or functions in views.py) bas...
Django-registration & Django-Socialauth
0
1.2
1
0
0
529
5,081,501
2011-02-22T17:19:00.000
2
0
1
0
1
python
0
5,081,579
0
1
0
true
0
0
The PATH doesn't affect where data files are found. (And your script is a data file as far as Windows is concerned). You should cd C:\Path\to\folder\with\your\scripts when you open your command prompt, and then you'll be able to python myscript.py from there. (You might like to make a dedicated shortcut to the command ...
1
0
0
0
I'm "new school" meaning that i've never really used the command prompt(they didn't teach us anything but IDE's in school). I would like to setup Python using Notepad++ for the editor, and winpdb as my debugger. I want stuff to work really easy from the cmd prompt but it is not. This is what I put in my System Environm...
Python command line SETUP for ABSOLUTE BEGINNER with Python
0
1.2
1
0
0
548
5,084,578
2011-02-22T22:07:00.000
1
0
0
0
0
python,nlp,nltk,named-entity-recognition
0
6,637,984
0
2
0
false
0
0
I haven't used NLTK enough recently, but if you have words that you know are skills, you don't need to do NER- just a text search. Maybe use Lucene or some other search library to find the text, and then annotate it? That's a lot of work but if you are working with a lot of data that might be ok. Alternatively, you cou...
1
4
1
0
I try to do named entity recognition in python using NLTK. I want to extract personal list of skills. I have the list of skills and would like to search them in requisition and tag the skills. I noticed that NLTK has NER tag for predefine tags like Person, Location etc. Is there a external gazetter tagger in Python I c...
Named Entity Recognition from personal Gazetter using Python
0
0.099668
1
0
0
2,226
5,085,099
2011-02-22T23:02:00.000
0
0
0
0
0
python,django,production-environment
0
48,786,643
0
3
0
false
1
0
Steps to get your Django App from development to Production open your project folder then find settings.py find the following line, SECURITY WARNING: don't run with debug turned on in production! DEBUG = False Change the debug to false. Change your db credentials with the actual production server db credentials in y...
1
1
0
0
I've been developing a django web-application for three months now, and I'd like to set it to production. I'm currently using South as database schema manager and I haven't got any clue on how to export my application databases schemas and content, and my project code to another directory; in order to set my production...
Exporting a development django application to production
0
0
1
0
0
2,805
5,086,524
2011-02-23T02:54:00.000
0
0
0
0
1
asp.net,python,selenium-rc
0
5,086,635
0
1
1
true
1
0
Ok, I upgrade my selenium-server to 2.0b2, now it's ok.
1
0
0
0
I use selenium-rc to test an asp.net website, test script is written in Python and the browser is Firefox 3.6. But When selenium open the first page of the website, A download dialog appear, not the web page, seems the page is proccessed as application/octet-stream, this cause my test script can not run successfully. S...
Why selenium can not open some asp page?
0
1.2
1
0
1
218
5,090,870
2011-02-23T12:23:00.000
3
0
0
0
0
python,mysql
0
5,090,944
0
1
0
true
0
0
Just open your CMD/Console, type python, press Enter, type import MySQLdb and then press Enter again. If no error is shown, you're ok!
1
0
0
0
I have installed MySqldb through .exe(precompiled). Its is stored in site-packages. But now i don't know how to test, that it is accessable or not. And major problem how to import in my application like import MySqldb. Help me i am very new techie in python i just want to work with my existing Mysql. Thanks in advance....
how to import mysqldb
0
1.2
1
1
0
165
5,093,153
2011-02-23T15:41:00.000
1
0
0
0
0
python,user-interface,macros,recorder
0
5,093,338
0
3
0
false
0
1
Thinking in high level, this is what I'd do: Develop a decorator function, with which I'd decorate every event-handling functions. This decorator functions would take note of thee function called, and its parameters (and possibly returning values) in a unified data-structure - taking care, on this data structure, to m...
2
2
0
0
I'm wondering how to go about implementing a macro recorder for a python gui (probably PyQt, but ideally agnostic). Something much like in Excel but instead of getting VB macros, it would create python code. Previously I made something for Tkinter where all callbacks pass through a single class that logged actions. Un...
Implementing a macro recorder for a python gui?
0
0.066568
1
0
0
1,816
5,093,153
2011-02-23T15:41:00.000
1
0
0
0
0
python,user-interface,macros,recorder
0
5,093,408
0
3
0
false
0
1
You could apply the command design pattern: when your user executes an action, generate a command that represents the changes required. You then implement some sort of command pipeline that executes the commands themselves, most likely just calling the methods you already have. Once the commands are executed, you can...
2
2
0
0
I'm wondering how to go about implementing a macro recorder for a python gui (probably PyQt, but ideally agnostic). Something much like in Excel but instead of getting VB macros, it would create python code. Previously I made something for Tkinter where all callbacks pass through a single class that logged actions. Un...
Implementing a macro recorder for a python gui?
0
0.066568
1
0
0
1,816
5,095,117
2011-02-23T18:13:00.000
1
0
0
1
0
java,python,google-app-engine
0
5,271,776
0
2
0
true
1
0
There is an API only available to Google Apps Resellers, if you are one of them you should get access to it.
1
1
0
0
I am currently working on a project that involves the google apps provisioning api. Without getting too detailed about the purpose or inner workings of the project, I would like to ask a very simple question: Is there a way to programmatically create a google apps for business domain (especially as a reseller)? After t...
Programmatically create Google Apps Domain
0
1.2
1
0
0
671
5,099,012
2011-02-24T00:23:00.000
1
0
0
0
0
python,google-app-engine,sorting
0
5,099,184
0
3
0
false
1
0
You could get the count of number of entities that have total_value less than or equal to the current users total_value. You could use the count() method to do so (on a Query object).
1
2
0
0
In my Main model I have a total_value and I sort with this value. When a user enters a value I wish to tell the user the order of his total_value. How do I do this? In other words, if total_values in database are 5,8,10,25 and a user enters a total_value of 15 how do I tell him that he will be in the 4th place? Thanks...
Google App Engine: how to tell sort location for a user value?
0
0.066568
1
0
0
95
5,107,675
2011-02-24T16:43:00.000
2
0
0
1
0
python,http,google-app-engine,asynchronous,request
0
5,111,470
0
4
0
false
1
0
Use the taskqueue. If you're just pushing data, there's no sense in waiting for the response.
2
4
0
0
Does anybody know how to make http request from Google App Engine without waiting a response? It should be like a push data with http without latency for response.
async http request on Google App Engine Python
0
0.099668
1
0
1
1,253
5,107,675
2011-02-24T16:43:00.000
0
0
0
1
0
python,http,google-app-engine,asynchronous,request
0
5,111,384
0
4
0
false
1
0
I've done this before by setting doing a URLFetch and setting a very low value for the deadline parameter. I put 0.1 as my value, so 100ms. You need to wrap the URLFetch in a try/catch also since the request will timeout.
2
4
0
0
Does anybody know how to make http request from Google App Engine without waiting a response? It should be like a push data with http without latency for response.
async http request on Google App Engine Python
0
0
1
0
1
1,253
5,112,248
2011-02-25T00:26:00.000
1
0
0
0
1
python,c,rgb
0
5,112,349
0
3
0
false
0
0
One option is to use OpenCV. Their Python bindings are pretty good (although not amazing). The upside is that it is a very powerful library, so this would just be the tip of the iceberg. You could probably also do this very efficiently using numpy.
1
3
1
0
well i've seen some code to convert RGB to HSL; but how to do it fast in python. Its strange to me, that for example photoshop does this within a second on a image, while in python this often takes forever. Well at least the code i use; so think i'm using wrong code to do it In my case my image is a simple but big raw ...
Python RGB array to HSL and back
0
0.066568
1
0
0
6,609
5,113,791
2011-02-25T04:57:00.000
1
0
0
1
1
python,windows,winapi,pywin32
0
5,114,093
0
3
0
true
0
0
win32api.TerminateProcess(handle, 0) works, but i'm concerned it may cause memory leaks because i won't have the opportunity to close the handle (program immediately stops after calling TerminateProcess). note: Yup, I am force quitting it so there are bound to be some unfreed resources, but I want to mi...
2
1
0
0
Edit: Looks like a duplicate, but I assure you, it's not. I'm looking to kill the current running process cleanly, not to kill a separate process. The problem is the process I'm killing isn't spawned by subprocess or exec. It's basically trying to kill itself. Here's the scenario: The program does cleanup on exit, but ...
In Windows using Python, how do I kill my process?
1
1.2
1
0
0
2,588
5,113,791
2011-02-25T04:57:00.000
1
0
0
1
1
python,windows,winapi,pywin32
0
14,405,624
0
3
0
false
0
0
TerminateProcess and taskkill /f do not free resources and will result in memory leaks. Here is the MS quote on terminateProcess: { ... Terminating a process does not cause child processes to be terminated. Terminating a process does not necessarily remove the process object from the system. A process object is delete...
2
1
0
0
Edit: Looks like a duplicate, but I assure you, it's not. I'm looking to kill the current running process cleanly, not to kill a separate process. The problem is the process I'm killing isn't spawned by subprocess or exec. It's basically trying to kill itself. Here's the scenario: The program does cleanup on exit, but ...
In Windows using Python, how do I kill my process?
1
0.066568
1
0
0
2,588
5,120,558
2011-02-25T17:31:00.000
0
1
0
0
0
python,mime,zip
0
5,120,702
0
2
0
false
0
0
This question does not make any sense. Files are stored as binary content inside the ZIP archive together with the filesize (and flags afaik). But there is absolutely no mimetype information involved here.
2
0
0
0
When creating zip archive using python ZipFile, how can i set file mime types?
Set ZipInfo mime type
0
0
1
0
0
1,396
5,120,558
2011-02-25T17:31:00.000
3
1
0
0
0
python,mime,zip
0
5,120,648
0
2
0
true
0
0
The ZIP format doesn't carry MIME content-type for the individual files contained in the archive, though the ZIP format itself has a MIME content-type: application\zip. The only way you've got to determine the appropriate MIME content-type for a file contained in a ZIP archive is by examination of the file name and usi...
2
0
0
0
When creating zip archive using python ZipFile, how can i set file mime types?
Set ZipInfo mime type
0
1.2
1
0
0
1,396
5,123,363
2011-02-25T22:22:00.000
1
0
0
0
0
python,computer-science
0
5,123,398
0
2
0
false
0
0
Do you mean you want to calculate the distance between the two points? If so, you just use the Pythagorean theorem: √((y1-y2)2+(x1-x2)2).
1
0
0
0
I'm constructing a program where the user clicks two points in the graphics window and the length of x and y must be shown. I've creating a clone and multiplying it by itself, but no luck. Any ideas? Thanks! Edit: My program is supposed to create a 'money bin' based off the users data and 2 point clicks in the graphics...
How do I calculate the length of an x/y coordinate in Python?
0
0.099668
1
0
0
1,821
5,125,544
2011-02-26T06:58:00.000
4
1
0
0
0
python,django,email,smtp,email-confirmation
0
5,126,778
0
1
0
true
1
0
List of delivered emails is outside of the scope of Django, which is a web framework and not a replacement for services like Mailchimp.
1
1
0
0
I want use send_mass_mail() in django and then want receive list of delivery mail list with email address and problem for failed or delivered ok status how i can make this modules ?
receive delivery list of send mail in django
0
1.2
1
0
0
415
5,127,921
2011-02-26T15:57:00.000
17
0
1
0
0
python,gzip,mmap
0
5,127,976
0
2
0
false
0
0
Well, not the way you want. mmap() can be used to access the gzipped file if the compressed data is what you want. mmap() is a system call for mapping disk blocks into RAM almost as if you were adding swap. You can't map the uncompressed data into RAM with mmap() as it is not on the disk.
1
13
0
0
I'm trying to figure how to use mmap with a gzip compressed file. Is that even possible ? import mmap import os import gzip filename = r'C:\temp\data.gz' file = gzip.open(filename, "rb+") size = os.path.getsize(filename) file = mmap.mmap(file.fileno(), size) print file.read(8) The output data is compressed.
Can mmap and gzip collaborate?
0
1
1
0
0
4,463
5,128,454
2011-02-26T17:18:00.000
0
0
1
0
0
javascript,python,json
0
5,128,524
0
5
0
false
0
0
I don't know Javascript or json, but... if you've ever seen an Unix-like operating system, you know about pipes. Like program1 | program2 | program3 ... Why don't you just connect Python and Javascript programs with pipes? The first one writes to stdout, and the next one reads from stdin.
3
1
0
0
the same problem haunting me a month ago is still haunting me now. i know ive asked several questions regarding this on this site and i am truly sorry for that. your suggestions have all been excellent but the answer is still elusive. i now realize that this is a direct result of me not being able to phrase my question...
is json the answer to this: python program will talk and javascript will listen?
0
0
1
0
0
950
5,128,454
2011-02-26T17:18:00.000
0
0
1
0
0
javascript,python,json
0
5,128,547
0
5
0
false
0
0
This probably isn't the answer that you are looking for, and without links to your previous posts, I don't have much to go on, but nonetheless... javascript is client side. I can interpret your question 2 different ways... Your python script is running on your computer, and you want a script to actually alter your cu...
3
1
0
0
the same problem haunting me a month ago is still haunting me now. i know ive asked several questions regarding this on this site and i am truly sorry for that. your suggestions have all been excellent but the answer is still elusive. i now realize that this is a direct result of me not being able to phrase my question...
is json the answer to this: python program will talk and javascript will listen?
0
0
1
0
0
950
5,128,454
2011-02-26T17:18:00.000
1
0
1
0
0
javascript,python,json
0
5,128,601
0
5
0
false
0
0
I assume you mean: Python is on the web server, and Javascript is running in the client's web browser. Because browsers are all different (IE6 is terrible, Chrome is great), there are a huge number of ways people found to "hack" this "cellphone" into place. These techniques are called AJAX and COMET techniques. There i...
3
1
0
0
the same problem haunting me a month ago is still haunting me now. i know ive asked several questions regarding this on this site and i am truly sorry for that. your suggestions have all been excellent but the answer is still elusive. i now realize that this is a direct result of me not being able to phrase my question...
is json the answer to this: python program will talk and javascript will listen?
0
0.039979
1
0
0
950
5,130,057
2011-02-26T22:05:00.000
0
0
1
0
0
python,jython,gstreamer
0
5,130,162
0
2
0
true
0
0
I suspect that it uses c bindings so you can not use in jython, sorry.
1
3
0
1
Does anyone know where I can find a tutorial on how to use GStreamer with Jython? I have tried searching but with no luck. Using the Gstreamer-Python bindings I can get a python file to run with python but jython gives me ImportError: No module named pygst.
Jython Gstreamer
0
1.2
1
0
0
278
5,132,648
2011-02-27T10:26:00.000
39
1
0
0
0
python,django,twisted,rabbitmq
0
19,206,575
0
7
0
false
0
0
Let me tell you a few reasons that makes using MOM (Message Oriented Middleware) probably the best choice. Decoupling: It can decouple/separate the core components of the application. There is no need to bring all the benefits of the decoupled architecture here. I just want to point it out that this is one of the main ...
3
68
0
1
Why do we need RabbitMQ when we have a more powerful network framework in Python called Twisted. I am trying to understand the reason why someone would want to use RabbitMQ. Could you please provide a scenario or an example using RabbitMQ? Also, where can I find a tutorial on how to use RabbitMQ?
Why do we need to use rabbitmq
1
1
1
0
0
20,812
5,132,648
2011-02-27T10:26:00.000
6
1
0
0
0
python,django,twisted,rabbitmq
0
27,416,485
0
7
0
false
0
0
RabbitMQ is a bit more than mere messaging... It's a common platform that has ability to inter-connect applications. Using RabbitMQ a Java application can speak to a Linux server and/or a .NET app, to a Ruby & rails + almost anything that finds its place in the corporate web development. And most importantly it impleme...
3
68
0
1
Why do we need RabbitMQ when we have a more powerful network framework in Python called Twisted. I am trying to understand the reason why someone would want to use RabbitMQ. Could you please provide a scenario or an example using RabbitMQ? Also, where can I find a tutorial on how to use RabbitMQ?
Why do we need to use rabbitmq
1
1
1
0
0
20,812
5,132,648
2011-02-27T10:26:00.000
14
1
0
0
0
python,django,twisted,rabbitmq
0
5,132,740
0
7
0
false
0
0
Twisted is not a queue implementation. Apart from that RabbitMQ offers enterprise-level queuing features and implements the AMQP protocol which is often needed in an enterprise world.
3
68
0
1
Why do we need RabbitMQ when we have a more powerful network framework in Python called Twisted. I am trying to understand the reason why someone would want to use RabbitMQ. Could you please provide a scenario or an example using RabbitMQ? Also, where can I find a tutorial on how to use RabbitMQ?
Why do we need to use rabbitmq
1
1
1
0
0
20,812
5,134,860
2011-02-27T18:00:00.000
1
0
1
0
0
python,list,hash,md5,checksum
0
5,134,890
0
2
0
false
0
0
You don't have 4 lists. You're printing the contents of the md5s each time after you call getmd5 which adds one md5 hash to the list. You just happen to be doing this 4 times, because you have 4 items in your files list. This means you have one list and it contains all the digests at the end of last for loop. You are p...
1
0
0
0
I'm working on a bit of a project in Python. I have a list of files that I want to get the md5checksums for. Then it stores the checksums in another list. Then it checks again and checks to see if they're different. I have the function for getting the checksums working but now I can't figure out how I'd add them to a l...
Computing MD5 checksums for files in a list
0
0.099668
1
0
0
2,384
5,136,266
2011-02-27T21:54:00.000
3
0
1
0
0
python,function,time,sleep
0
10,023,537
0
3
0
false
0
0
If you're running your script on command line, try using the -u parameter. It runs the script in unbuffered mode and did the trick for me. For example: python -u my_script.py
1
8
0
0
Hey I need to know how to sleep in Python without interfering with the current script. I've tried using time.sleep() but it makes the entire script sleep. Like for example import time def func1(): func2() print("Do stuff here") def func2(): time.sleep(10) print("Do more stuff here") func1() I want i...
Python sleep without interfering with script?
0
0.197375
1
0
0
14,596
5,148,790
2011-02-28T23:23:00.000
0
0
1
0
1
python,casting
0
5,148,795
0
2
0
false
0
0
ord(val) will give you the integer value of a character. int(val) will cast a value into an integer.
1
0
0
0
I had a postgresql query where I need to take column defined as character from table and then pass this value to the function where it only accepts integer.So in this case, how can i solve the problem??Can anyone help??
how to convert value of column defined as character into integer in python
0
0
1
1
0
126
5,154,479
2011-03-01T12:25:00.000
0
0
0
1
0
python,django,ubuntu-10.10
0
5,154,551
0
1
0
true
1
0
Install python2.5 with synaptic, then you will be able to use easy_install2.5 to install django. If you don't have the python2.5 in your package list you can put django on your python2.5 system path and be with it to view the system path do: python2.5 import sys sys.path
1
0
0
0
AppEngine needs Python2.5. Ubuntu 2010.10 comes with Python 2.6.6 and I didn't want to interfere with it, so I downloaded and compiled Python 2.5 in my home directory. Then I downloaded Django-1.2.5.tar.gz, and ran "sudo python setup.py install". Problem: "import django" says "ImportError: No module named django" I gu...
Django on python2.5
0
1.2
1
0
0
238
5,164,307
2011-03-02T06:50:00.000
0
0
0
0
0
python,django
0
5,164,550
0
3
0
false
1
0
Post.objects.all(catagory__title="My catagory title")?
1
1
0
0
how in django find list of post related with special many to many field? for example catagory have title post have many to many relation to catagory how find all post from category title
many to many problem django
0
0
1
0
0
352
5,168,207
2011-03-02T13:36:00.000
0
0
0
0
0
python,django
0
5,168,529
0
6
0
false
1
0
I'd go for separate boolean columns. It'll be a lot easier for you to then query, say, for users that are available on mondays; or to count the number of users that available through every weekday, or whatever.
2
5
0
0
I want to store users preferences for day(s) of week he might be available. e.g. A user can be available on saturday, sunday but not on other days. Currently I am using array of 7 checkboxes(values=1,2,...7) so that user can select individual days of his availability. Now the first question is how can i store this in d...
Best way to save availability of user over days of week in python/django
0
0
1
0
0
1,639
5,168,207
2011-03-02T13:36:00.000
1
0
0
0
0
python,django
0
5,168,522
0
6
0
false
1
0
One other option is the more-or-less obvious one: define a table of the days of the week, and have a ManyToManyField map one to the other. The admin would just work, you can do searches based on dates, and it works on SQLite unlike some of the functions in django-bitfield. Searches can be fast, since they're within the...
2
5
0
0
I want to store users preferences for day(s) of week he might be available. e.g. A user can be available on saturday, sunday but not on other days. Currently I am using array of 7 checkboxes(values=1,2,...7) so that user can select individual days of his availability. Now the first question is how can i store this in d...
Best way to save availability of user over days of week in python/django
0
0.033321
1
0
0
1,639
5,172,735
2011-03-02T20:02:00.000
0
0
0
0
0
python,facebook,facebook-graph-api,facebook-fql
0
5,365,134
0
1
0
true
0
0
I don't think it's possible to edit a Video object at all with the Graph API at the moment. You can't create objects through the API, therefore I don't think you can edit or modify existing ones either.
1
1
0
0
How can I update the title/description of a previously updated video? I am using python and pyfacebook... but any starting point would be fine and I can write it in python.
how do I use the facebook api to modify a video title or description?
0
1.2
1
0
0
137
5,174,269
2011-03-02T22:22:00.000
4
0
0
0
0
python,sql,sql-server
0
5,174,307
0
2
0
false
0
0
You could just run them using sqlcmd. Sqlcmd is a command line utility that will let you run .sql scripts from the command line, which I'm sure you can kick off through python.
1
1
0
0
As part of artifacts delivery, our developers give the data and structure scripts in .sql files. I usually "double click" on these files to open in "Microsoft SQL Server Management Studio". Management studio will prompt me for entering database server and user/pwd. I enter them manually and click on Execute button to e...
Execute .sql files that are used to run in SQL Management Studio in python
0
0.379949
1
1
0
3,938
5,174,810
2011-03-02T23:25:00.000
9
0
0
1
0
python,text-cursor,command-window
0
70,550,803
0
4
0
false
0
0
I'm surprised nobody mentioned that before, but you actually don't need any library to do that. Just use print('\033[?25l', end="") to hide the cursor. You can show it back with print('\033[?25h', end=""). It's as easy as that :)
1
16
0
0
I have a Python script that sends output to a DOS command window (I am using Windows 7) using the print() function, but I would like to prevent (or hide) the cursor from blinking at the next available output position. Has anyone any idea how I can do this? I have looked at a list of DOS commands but I cannot find any...
How to turn off blinking cursor in command window?
0
1
1
0
0
16,984
5,179,743
2011-03-03T10:53:00.000
0
0
1
0
1
python,windows-server-2003,py2exe,pywin32,x86-64
0
6,172,840
0
1
0
false
0
0
You might want to check out the subprocess and threading modules that come with the standard Python library with regards to your multi-core issue. As for the 64bit issue, are you sure you need the additional memory space? I've never had any issue with 32bit python.
1
0
0
0
My problem is my python binaries not running as 64bits program on my amd64(Opteron 8214, 4 cpu) server. The machine is a Dual-Core, so there are 8 core shown in taskmgr. It shown no "*32" in taskmgr(so it probably already in 64bits mode), but use only one core. And I take same code(project) to compiled and executed on ...
My python build binaries not really running as 64bit program in AMD Win2003r2x64 machine
0
0
1
0
0
197
5,185,563
2011-03-03T19:34:00.000
1
0
0
0
0
python,django
0
5,185,748
0
4
0
false
1
0
I've had a similar problem and I've ended up adding a counter into the Album equivalent. If the count is 0 and the operation is delete(), then the album object is delete()d. Other solution os to overload the delete() method in the song model, or use post-delete to delete the album.
1
6
0
0
I am writing a small music database. Learning SQL lies quite a long time in my past and I always wanted to give Django a try. But there is one thing I couldn't wrap my head around. Right now, my models only consist of two Classes, Album and Song. Song has a foreign key pointing to the album it belongs to. Now if I woul...
What is the reverse equivalent of cascade?
1
0.049958
1
0
0
1,807
5,190,030
2011-03-04T05:25:00.000
0
0
1
1
0
python,macos,terminal
0
5,190,101
0
6
0
false
0
0
The statements which represent a block of code below end with a colon(:) in Python. By doing that way, you can add extra statements under a single block and execute them at once.
2
12
0
0
I'm using Python in Terminal on Mac OSX latest. When I press enter, it processes the code I've entered, and I am unable to figure out how to add an additional line of code e.g. for a basic loop.
How do I create a line-break in Terminal?
0
0
1
0
0
43,483
5,190,030
2011-03-04T05:25:00.000
1
0
1
1
0
python,macos,terminal
0
25,158,836
0
6
0
false
0
0
The answer here is far more simple. If you want to continue in the next line after a loop like while b<1: when you press enter you get prompted with ... then you "have to make an indent" by space of tab and only then you can put more code after the three dots like ... (tab or space) print b then when you press en...
2
12
0
0
I'm using Python in Terminal on Mac OSX latest. When I press enter, it processes the code I've entered, and I am unable to figure out how to add an additional line of code e.g. for a basic loop.
How do I create a line-break in Terminal?
0
0.033321
1
0
0
43,483
5,194,343
2011-03-04T13:30:00.000
0
0
1
1
0
python,osx-snow-leopard,virtualenv,homebrew
0
5,195,551
0
2
1
false
0
0
I use the python_select utility to switch between versions (it takes care of all the paths and links). It's easy to install with MacPorts or fink, so I would guess you can install the same utility with Homebrew.
2
0
0
0
whats is the current best practice for installing multiple versions of python on snow leopard? have setup python 2.7.1 via Homebrew, very easy process, all great. but now I need to setup python 2.5 to develop an appengine project.. Initially created a new virtualenv against system python2.5 .. but finding I have all ...
how to install multiple python versions on snow leopard?
0
0
1
0
0
1,005
5,194,343
2011-03-04T13:30:00.000
2
0
1
1
0
python,osx-snow-leopard,virtualenv,homebrew
0
5,194,593
0
2
1
true
0
0
Snow leopard already contains python 2.5 and python 2.6, no issues there. If you require obscure modifications to the python installations, just compile your own, and put it in some place where it won't conflict with the system python. (I suggest /opt/your-pythonx.y). As an aside, check: "man python" on mac to see how ...
2
0
0
0
whats is the current best practice for installing multiple versions of python on snow leopard? have setup python 2.7.1 via Homebrew, very easy process, all great. but now I need to setup python 2.5 to develop an appengine project.. Initially created a new virtualenv against system python2.5 .. but finding I have all ...
how to install multiple python versions on snow leopard?
0
1.2
1
0
0
1,005
5,209,003
2011-03-06T06:00:00.000
0
1
0
0
0
python,api,twitter
0
5,209,588
0
1
0
true
0
0
A tweet itself comes with a geo tag. But it is a new feature and majority tweets do not have it. So it is not possible to search for all tweets containing "Gaddafi" from a city given the city name. What you could do is the reverse, you search for "Gaddafi" first (regardless of geo location), using search api. Then, for...
1
0
0
0
I have little working knowledge of python. I know that there is something called a Twitter search API, but I'm not really sure what I'm doing. I know what I need to do: I need point data for a class. I thought I would just pull up a map of the world in a GIS application, select cities that have x population or larger, ...
Performing multiple searches of a term in Twitter
0
1.2
1
0
1
268
5,211,338
2011-03-06T15:26:00.000
0
0
0
0
0
python,django,rendering
0
5,216,170
0
3
0
false
1
0
By default mod_python decides when to reload, so you'll get what you get when you get it. Maybe I am mistaken, but I thought there was a directive you could send that would explicitly force the python reload now. That should (in theory) help with achieving consistent but perhaps not ideal, behavior. Off topic, this so...
1
0
0
0
Well main question of the day will django work correctly under python 2.5.2 ? So why i am asking this question? First of all i have some test class written , nothing special which renders a page. The problem is that everytime i access this page i get random 3 different responses : 1)exceptions must be classes, instanc...
Django 1.2.3 compatible with python 2.5.2 ? Weird django behaviour
0
0
1
0
0
180
5,211,340
2011-03-06T15:26:00.000
3
0
0
0
1
python,django,sqlite
1
5,211,417
0
3
0
false
1
0
As always, syncdb does not migrate the existing schema.
1
4
0
0
I'm not sure if this is an issue specific to sqlite databases but after adding some properties I executed syncdb successfully but still the the columns were not added to the database and when I try the access the model in admin I get no such column error. Why is this happening and how do I overcome this issue? Details:...
Django manage.py syncdb doing nothing when used with sqlite3
0
0.197375
1
1
0
5,639
5,214,369
2011-03-06T23:52:00.000
12
0
1
0
0
python,matlab,ide
0
6,088,759
0
11
0
false
0
0
I've been getting on very well with the Spyder IDE in the Python(x,y) distribution. I'm a long term user of Matlab and have known of the existence of Python for 10 years or so but it's only since I installed Python(x,y) that I've started using Python regularly.
5
26
1
0
I'm considering making the switch from MATLAB to Python. The application is quantitative trading and cost is not really an issue. There are a few things I love about MATLAB and am wondering how Python stacks up (could not find any answers in the reviews I've read). Is there an IDE for Python that is as good as MATLAB'...
Python vs Matlab
0
1
1
0
0
47,020
5,214,369
2011-03-06T23:52:00.000
2
0
1
0
0
python,matlab,ide
0
10,388,279
0
11
0
false
0
0
after long long tryouts with many editors, i have settled for aptana ide + ipython (including notebook in internet browser) great for editing, getting help easy, try fast new things aptana is the same as eclipse (because of pydev) but aptana has themes and different little things eclipse lacks about python a little, do...
5
26
1
0
I'm considering making the switch from MATLAB to Python. The application is quantitative trading and cost is not really an issue. There are a few things I love about MATLAB and am wondering how Python stacks up (could not find any answers in the reviews I've read). Is there an IDE for Python that is as good as MATLAB'...
Python vs Matlab
0
0.036348
1
0
0
47,020
5,214,369
2011-03-06T23:52:00.000
6
0
1
0
0
python,matlab,ide
0
41,910,220
0
11
0
false
0
0
I've been in the engineering field for a while now and I've always used MATLAB for high-complexity math calculations. I never really had an major problems with it, but I wasn't super enthusiastic about it either. A few months ago I found out I was going to be a TA for a numerical methods class and that it would be taug...
5
26
1
0
I'm considering making the switch from MATLAB to Python. The application is quantitative trading and cost is not really an issue. There are a few things I love about MATLAB and am wondering how Python stacks up (could not find any answers in the reviews I've read). Is there an IDE for Python that is as good as MATLAB'...
Python vs Matlab
0
1
1
0
0
47,020
5,214,369
2011-03-06T23:52:00.000
2
0
1
0
0
python,matlab,ide
0
5,214,892
0
11
0
false
0
0
almost everything is covered by others .. i hope you don't need any toolboxes like optimizarion toolbox , neural network etc.. [ I didn't find these for python may be there are some .. i seriously doubt they might be better than Matlab ones..] if u don't need symbolic manipulation capability and are using windows pyth...
5
26
1
0
I'm considering making the switch from MATLAB to Python. The application is quantitative trading and cost is not really an issue. There are a few things I love about MATLAB and am wondering how Python stacks up (could not find any answers in the reviews I've read). Is there an IDE for Python that is as good as MATLAB'...
Python vs Matlab
0
0.036348
1
0
0
47,020
5,214,369
2011-03-06T23:52:00.000
1
0
1
0
0
python,matlab,ide
0
9,317,942
0
11
0
false
0
0
I have recently switched from MATLAB to Python (I am about 2 months into the transition), and am getting on fairly well using Sublime Text 2, using the SublimeRope and SublimeLinter plugins to provide some IDE-like capabilities, as well as pudb to provide some graphical interactive debugging capabilities. I have not ye...
5
26
1
0
I'm considering making the switch from MATLAB to Python. The application is quantitative trading and cost is not really an issue. There are a few things I love about MATLAB and am wondering how Python stacks up (could not find any answers in the reviews I've read). Is there an IDE for Python that is as good as MATLAB'...
Python vs Matlab
0
0.01818
1
0
0
47,020
5,215,883
2011-03-07T04:38:00.000
3
0
1
0
0
python,bdd,lettuce
0
5,665,792
0
2
0
true
0
0
There is a "behave_as" feature for Lettuce which should do this. Though there were some bugs with it last time I tried to use it. May be fixed now. I opened a bug on it with Gabriel, the author.
1
3
0
0
I am using Lettuce BDD framework for python, and I am wondering how to run one scenario from within another scenario.. For example, say there is a "registration" scenario that establishes some pre-conditions which will be used by a subsequent scenario (say "action" scenario") - how do I refer and call the "registratio...
Lettuce BDD : How to refer scenarios?
0
1.2
1
0
0
822
5,217,033
2011-03-07T07:34:00.000
1
0
0
1
0
python,date
0
5,217,076
0
2
0
false
0
0
If you use Windows, you should be able to do that in the time and date control panel (should be self explaining). If you use Linux, use the date command, and maybe hwclock (more info in the man pages). If you use AmigaOS, use the appropriate settings window in the system Preferences folder. If you use any other OS, yo...
2
0
0
0
I need to change my computer's local date to an earlier date (e.g. 2010). I couldnt do that in BIOS. Does anybody know how to do this task, for example by writing a Python snippet? Thanks.
Change system date
0
0.099668
1
0
0
666
5,217,033
2011-03-07T07:34:00.000
1
0
0
1
0
python,date
0
5,375,660
0
2
0
false
0
0
If you are not permitted to do this via the operating system, then you will not be permitted to do it from a scripting language like Python, either.
2
0
0
0
I need to change my computer's local date to an earlier date (e.g. 2010). I couldnt do that in BIOS. Does anybody know how to do this task, for example by writing a Python snippet? Thanks.
Change system date
0
0.099668
1
0
0
666
5,221,977
2011-03-07T16:12:00.000
6
0
0
1
0
python,google-app-engine,caching,memcached,google-cloud-datastore
0
5,222,081
0
3
0
true
1
0
This is a recipe for lost data. I have a hard time believing that a guest book is causing enough write activity to be an issue. Also, the bookkeeping involved in this would be tricky, since memcache isn't searchable.
1
2
0
0
I am trying to modify the guestbook example webapp to reduce the amount of database writes. What I am trying to achieve is to load all the guestbook entries into memcache which I have done. However I want to be able to directly update the memcache with new guestbook entries and then write all changes to the database a...
Limit amount of writes to database using memcache
0
1.2
1
1
0
1,124
5,225,780
2011-03-07T22:00:00.000
12
0
0
0
0
python,postgresql,sqlalchemy
0
5,331,129
0
2
0
false
0
0
the warning means you did a table or metadata reflection, and it's reading in postgresql indexes that have some complex condition which the SQLAlchemy reflection code doesn't know what to do with. This is a harmless warning, as whether or not indexes are reflected doesn't affect the operation of the application, unle...
1
35
0
0
I'm using sqlalchemy with reflection, a couple of partial indices in my DB make it dump warnings like this: SAWarning: Predicate of partial index i_some_index ignored during reflection into my logs and keep cluttering. It does not hinder my application behavior. I would like to keep these warnings while developing, but...
Turn off a warning in sqlalchemy
0
1
1
1
0
14,820
5,240,646
2011-03-09T02:27:00.000
5
0
0
0
0
python,web2py
0
5,240,964
0
1
0
true
1
0
Yes, it works fine with svn, hg, whatever source control you need to use. Sometimes people think that you have to code with web2py's admin interface, but that really is not the case, once you realize it can be edited with any of your regular tools, you will see that you don't have to treat it any differently when it c...
1
1
0
0
I just start to learn python and web2py. Because of web2py's web interface development, I am wondering how can web2py work with svn? If a team wants to build a website,how do they work together? How to control the iteration of source code?
Can web2py work with svn?
0
1.2
1
0
1
742
5,242,230
2011-03-09T06:37:00.000
0
0
0
0
0
python,django,web-applications,django-models
0
5,245,050
0
2
0
false
1
0
i think better to use `memcached (http://memcached.org/) in mem cached server and each server see this server also you can serialize your data and send it like udp and other method
2
0
0
1
I have a TCP server, a Python app, that gets the information from the connected devices. This information I am trying to show using Django web app. So, basically my model objects reside within the TCP server process. I can modify the TCP server to put the information into SQLite database and have my Django web app take...
django - how to get model objects from another process instead of database
0
0
1
0
0
246
5,242,230
2011-03-09T06:37:00.000
1
0
0
0
0
python,django,web-applications,django-models
0
5,244,998
0
2
0
true
1
0
You may be able to serialise your model and pass the serialised data.
2
0
0
1
I have a TCP server, a Python app, that gets the information from the connected devices. This information I am trying to show using Django web app. So, basically my model objects reside within the TCP server process. I can modify the TCP server to put the information into SQLite database and have my Django web app take...
django - how to get model objects from another process instead of database
0
1.2
1
0
0
246
5,246,856
2011-03-09T14:01:00.000
0
1
1
0
0
python,algorithm,math
0
5,246,963
0
6
0
false
0
0
Python uses C math libraries for general cases and its own logic for some of its concepts (such as infinity).
1
56
0
0
I have to write a program to calculate a**b % c where b and c are both very large numbers. If I just use a**b % c, it's really slow. Then I found that the built-in function pow() can do this really fast by calling pow(a, b, c). I'm curious to know how does Python implement this? Or where could I find the source code f...
How did Python implement the built-in function pow()?
0
0
1
0
0
37,922
5,258,623
2011-03-10T10:52:00.000
5
0
1
0
0
python
0
5,258,931
0
3
0
false
0
0
For example using the encode method: u"Mikael Håfström".encode("ascii", "ignore")
1
10
0
0
i have a string "Mikael Håfström" which contains some special characters how do i remove this using python?
remove special characters from string
0
0.321513
1
0
0
12,590
5,264,414
2011-03-10T18:58:00.000
0
0
0
1
0
python,django,unix,tcp,communication
0
5,264,700
0
2
0
false
0
0
Some general ideas for you: You could have a master-client approach. Requests would be inserted in the master, stored in a database. Master knows the state of each client (same db). Whenever there is a request, the master redirects it to a free client. The client reports back when has finished the task (including answe...
1
0
0
0
Mornink! I need to design, write and implement wide system consisting of multiple unix servers performing different roles and running different services. The system must be bullet proof, robust and fast. Yeah, I know. ;) Since I dont know how to approach this task, I've decided to ask you for your opinion before I leav...
What is best pythonic way to communicate between spreaded services/unix machines?
0
0
1
0
0
219
5,266,425
2011-03-10T21:59:00.000
2
0
0
0
0
jquery,python,django,forms
0
5,266,823
0
3
0
true
1
0
Create a Django view which renders just the HTML for the form using your preferred template. Then use $.ajax() with dataType: "html" to get the code for the form for use in your overlay.
1
1
0
0
I've installed the django-newsletter application, and customized the subscribing form. But, right now, I'd like to print it through a Jquery Overlay, instead of a flatpage containing that form. Problem is I don't know how to include this flatpages elements into every page where the link calling the overlay will be pre...
How to call django template in order to use it through Jquery?
0
1.2
1
0
0
830
5,275,488
2011-03-11T16:21:00.000
0
0
1
1
0
python,timezone,tornado
0
5,275,903
0
3
0
false
0
0
Pardon my dimness but why do you mean to format the date based on the user in the context of Tornado? Tornado is a server. The user is a client.
1
2
0
0
How do people handle timezones in Tornado so that users see time formatted relative to their timezone? I know there's locale.format_date which defaults to GMT, but how do I set the right timezone based on the user?
Setting timezone in Tornado
0
0
1
0
0
1,179
5,283,506
2011-03-12T15:44:00.000
0
0
0
1
0
python,google-app-engine
0
5,283,536
0
3
0
false
1
0
When you log in (the blue box where you enter the email) there is a checkbox to apply the administrator flag to your session.
1
3
0
0
I want to create an Admin-only page for my GAE application. But I found there's no way to set a Admin user, so I cannot log on the page I created and test the function. I tried the local Admin console, but no luck. How can I do this?
how to set the admin user with GAE dev app server?
0
0
1
0
0
924
5,287,113
2011-03-13T03:02:00.000
1
1
0
0
1
python,apache,cgi
0
5,287,233
0
1
0
false
1
0
I think I figured it out. I need to use the environ variable passed to the application function by mod_wsgi. Thanks!
1
0
0
0
I am trying to get the query string in a CGI python script because for some reason the .FieldStorage and .getvalue functions are returning "None". The query is being generated correctly. I checked it in Wireshark and it is correctly produced. Any ideas on how I can just get the string itself correctly? I was trying to ...
Get the GET query in a Python CGI script (Apache, mod_cgi)
0
0.197375
1
0
0
669
5,291,479
2011-03-13T18:36:00.000
0
0
1
0
1
python,indentation,prompt
0
26,475,538
0
2
0
false
0
0
I recently observed this behavior too, on Windows, using cmd.exe. It also happens with Console2 - an alternate shell I sometimes use. Though I do always use spaces in normal code in an editor, I had been accustomed to using the Tab key to indent in short multi-line inputs in the interactive python.exe interpreter. Rece...
2
2
0
0
hi everyone :) my problem is, up until now, i have exclusively used tabs to indent python, as i find it easier than spaces, but for no reason i know, python interactive prompt, the basic python.exe one, suddenly refuses to accept the tab button, all it does is flash the cursor. all i can think of is that my computer in...
indent with 'tab' button in python commandline
0
0
1
0
0
5,644
5,291,479
2011-03-13T18:36:00.000
1
0
1
0
1
python,indentation,prompt
0
5,291,864
0
2
0
false
0
0
If you are using Windows with the standard cmd.exe console (and it would have been helpful for you to have stated this up front) then you can use the TAB and arrow keys exactly as you desire.
2
2
0
0
hi everyone :) my problem is, up until now, i have exclusively used tabs to indent python, as i find it easier than spaces, but for no reason i know, python interactive prompt, the basic python.exe one, suddenly refuses to accept the tab button, all it does is flash the cursor. all i can think of is that my computer in...
indent with 'tab' button in python commandline
0
0.099668
1
0
0
5,644
5,299,280
2011-03-14T13:35:00.000
1
0
0
0
0
python,algorithm,variations
0
5,299,434
0
3
0
false
0
0
I'd solve this exercise with dynamic programming. You should be able to get the optimal solution in O(m*n) operations (n beeing the number of cars, m beeing the total mass). That will only work however if the masses are all integers. In general you have a binary linear programming problem. Those are very hard in genera...
1
2
1
0
I need to make a program in python that chooses cars from an array, that is filled with the mass of 10 cars. The idea is that it fills a barge, that can hold ~8 tonnes most effectively and minimum space is left unfilled. My idea is, that it makes variations of the masses and chooses one, that is closest to the max weig...
Program, that chooses the best out of 10
0
0.066568
1
0
0
230
5,322,445
2011-03-16T08:00:00.000
5
0
0
1
0
python,gevent
0
5,338,718
0
3
0
true
0
0
first instance of StreamServer could be started with: server.start() and second with server2.serve_forever()
2
3
0
0
I have daemon which has connection pool to handlerSocket. I have 2 types of clients and their protocol differs. I want to setup 2 listeners which handles each protocol and shares connection pool between them. In twisted this is relatively easy to accomplish, but couldn't find out how to do this in gevent. Thanks!
gevent multiple StreamServer listeners
0
1.2
1
0
0
1,772
5,322,445
2011-03-16T08:00:00.000
0
0
0
1
0
python,gevent
0
8,439,364
0
3
0
false
0
0
I think the problem will come from the StreamServer's stop() method. It kills the pool, so, finishing one of listeners will drop all connections, from both listeners. If this is does not frighten you, you can simply pass the same Pool object to both StreamServers, running each of them in the separate greenlet.
2
3
0
0
I have daemon which has connection pool to handlerSocket. I have 2 types of clients and their protocol differs. I want to setup 2 listeners which handles each protocol and shares connection pool between them. In twisted this is relatively easy to accomplish, but couldn't find out how to do this in gevent. Thanks!
gevent multiple StreamServer listeners
0
0
1
0
0
1,772
5,335,845
2011-03-17T06:57:00.000
0
0
0
0
0
python,mysql,django
0
5,336,126
0
2
0
false
1
0
I have a feeling your database schema knows this is a date, right? In that case it's not being stored in the format you describe, but as some representation such as seconds since the era. This means that when you retreave it your code has to do something with it to make it look right. If you don't tell it how to look ...
1
0
0
0
my datetime property is saving in mysql in this format 2011-03-17 00:00:00 but after fetchind the data with filter function it is giving March 17,2011 midnight but i have not say to do any this type of task. My question is how can i insist django to stic to show same value what is saved in MYSQL.
django autoconverting datetime property
0
0
1
0
0
699
5,344,641
2011-03-17T20:10:00.000
0
0
0
1
0
python,linux,centos,cassandra,yum
0
5,344,716
0
2
0
false
0
0
Try installing rrdtool via yum, that should contain librrd.so.2 and correct your issue.
1
2
0
0
I am attemping to install OpsCenter for Cassandra, and using the the standard REHL image. I can't figure out how to get this to work. Another version of EPEL perhaps? yum install opscenter.... Error: Package: python26-rrdtool-1.2.27-1.i386 (opscenter) Requires: librrd.so.2
Amazon Linux AMI EC2 - librrd.so.2 dependency issue
0
0
1
1
0
410