Q_Id int64 337 49.3M | CreationDate stringlengths 23 23 | Users Score int64 -42 1.15k | Other int64 0 1 | Python Basics and Environment int64 0 1 | System Administration and DevOps int64 0 1 | Tags stringlengths 6 105 | A_Id int64 518 72.5M | AnswerCount int64 1 64 | is_accepted bool 2
classes | Web Development int64 0 1 | GUI and Desktop Applications int64 0 1 | Answer stringlengths 6 11.6k | Available Count int64 1 31 | Q_Score int64 0 6.79k | Data Science and Machine Learning int64 0 1 | Question stringlengths 15 29k | Title stringlengths 11 150 | Score float64 -1 1.2 | Database and SQL int64 0 1 | Networking and APIs int64 0 1 | ViewCount int64 8 6.81M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,137,517 | 2010-01-26T04:26:00.000 | 0 | 0 | 0 | 0 | python,pygtk,gtk | 2,137,653 | 2 | false | 0 | 1 | It can't be done, in general. If you're talking about a line of your pygtk program, then you would need an API for your IDE (development environment) to find out where a particular source code line is currently displayed on the screen, if anywhere. If by "line number" you mean something else, then as Ignacio says, yo... | 1 | 0 | 0 | I have a application written in PyGtk. I need to convert a particular line number into its corresponding window co-ordinates in a GtkTextView. How can this be done? | Convert Line Number Into its corresponding co-ordinates | 0 | 0 | 0 | 131 |
2,138,415 | 2010-01-26T09:18:00.000 | 1 | 0 | 1 | 0 | python,dll,regfreecom,win32com | 13,718,199 | 1 | false | 0 | 0 | This kind of information is hard, very very hard to find information about. I am attempting to find the same but for Ruby, however I expect that the same issue will occur. Ultimately, however, a Manifest file is required, and at least during development, it may help to register the .dll anyway, and then work on makin... | 1 | 3 | 0 | I am currently using the win32com module of CPython to use a DLL.
I know some people using IronPython to automagically get the list of functions provided by this DLL. They don't need to register the DLL.
I'd like to do the same as them but with CPython.
1) Is it possible to use CPython and win32com to connect to a dll ... | RegFree DLL with CPython using win32com module | 0.197375 | 0 | 0 | 350 |
2,138,868 | 2010-01-26T10:51:00.000 | 0 | 0 | 0 | 0 | python,django,gwt,extjs,webclient | 2,140,012 | 5 | false | 1 | 0 | How about Pylons + SQLAlchemy + ExtJS? We use it and it works great! | 2 | 5 | 0 | I've well developed Python Server having workflows, views, object - ORM/OSV, etc...
Server/Client communication based on socket protocol, can be done by any of service
1. XMLRPC Service
2. Socket Service
now I want to develop a Fully Ajax based GUI web Client..
I've web/socket services to communicate with server.
wh... | Which technology is preferable to build a web based GUI Client? | 0 | 0 | 1 | 2,943 |
2,138,868 | 2010-01-26T10:51:00.000 | 1 | 0 | 0 | 0 | python,django,gwt,extjs,webclient | 2,138,949 | 5 | false | 1 | 0 | I'm not sure I understood exactly on the server side, but i'm a big fan of Flex as a way to develop proper software for the browser, rather than mess of trying to make HTML do things it was never made for. Partly an idealistic reasoning, but I also am still not impressed by the 'feel' of JS-based GUIs.
Flex has good se... | 2 | 5 | 0 | I've well developed Python Server having workflows, views, object - ORM/OSV, etc...
Server/Client communication based on socket protocol, can be done by any of service
1. XMLRPC Service
2. Socket Service
now I want to develop a Fully Ajax based GUI web Client..
I've web/socket services to communicate with server.
wh... | Which technology is preferable to build a web based GUI Client? | 0.039979 | 0 | 1 | 2,943 |
2,139,823 | 2010-01-26T14:02:00.000 | 0 | 0 | 0 | 1 | python,bash,awk | 2,139,973 | 5 | false | 0 | 0 | Doing this in Python should be pretty trivial. It's probably possible in awk, but sounds a bit too complicated to be fun. It's surely is possible in bash, but programming in bash is for masochists.
I'd go with Python, of the given options, although Perl and Ruby are good options too if you know them. | 1 | 1 | 0 | I have a set of 10000 files c1.dat ... c10000.dat. Each of these files contains a line which starts with @ and contains a string with spaces specific for this file, lije c37 7.379 6.23.
I have another set of 10000 files kind of determined_cXXX_send.dat (where XXX goes from 1 to 10000). Each of these files has only one... | Bash or Python or Awk to match and modify files | 0 | 0 | 0 | 592 |
2,140,142 | 2010-01-26T14:53:00.000 | 0 | 1 | 0 | 0 | python,facebook,pyfacebook | 2,140,233 | 3 | false | 1 | 0 | I've never used PyFacebook. Or tried to resume sessions in this manner. But I'd imagine just storing session_key and uid is not enough. There are other params too, and a signature param that's calculated based on all the fb_* params. So you might need to store all of them.
But even so, they might only work for 20-30 mi... | 2 | 2 | 0 | I am trying to set a cron task to read updates for a Facebook application. I have prompted the user to grant Offline Access permissions and i have store the session_key in the db.
I am crearing a new Facebook object and besides api and secret key I also use the session_key (previously stored in db) and the fb uid. When... | PyFacebook Infinite Session | 0 | 0 | 0 | 819 |
2,140,142 | 2010-01-26T14:53:00.000 | 1 | 1 | 0 | 0 | python,facebook,pyfacebook | 11,015,676 | 3 | false | 1 | 0 | I faced the same problem where the error displayed was:
"facebook.FacebookError: Error 104: Incorrect signature"
Just reset your APP Secret_key and make corresponding change in the code and that sgould fix the problem.
Cheers! | 2 | 2 | 0 | I am trying to set a cron task to read updates for a Facebook application. I have prompted the user to grant Offline Access permissions and i have store the session_key in the db.
I am crearing a new Facebook object and besides api and secret key I also use the session_key (previously stored in db) and the fb uid. When... | PyFacebook Infinite Session | 0.066568 | 0 | 0 | 819 |
2,140,836 | 2010-01-26T16:33:00.000 | 1 | 0 | 1 | 0 | python,windows,pyqt,importerror | 10,279,385 | 8 | false | 0 | 1 | PyQt installation also depends on the version of python installed on your platform.Python3.+ is incompatible with Python version < 3.x.
I was facing the same problem as I have Python 2.7 installed on my machine but I downloaded the latest binary which was PyQt-Py3.2-x86-gpl-4.9.exe. If you see here the binary has pytho... | 5 | 11 | 0 | I've been trying to install PyQt 4.7 on Vista, but I am getting an ImportError when I try to do: from PyQt4 import QtCore, QtGui.
ImportError: DLL load failed: The specified module could not be found.
I've checked my System Path, and C:\Python31\Lib\site-packages\PyQt4\bin is on there.
I can't run any of the example... | PyQt 4.7 - ImportError after installing on Windows | 0.024995 | 0 | 0 | 24,135 |
2,140,836 | 2010-01-26T16:33:00.000 | 2 | 0 | 1 | 0 | python,windows,pyqt,importerror | 4,452,810 | 8 | false | 0 | 1 | Just wanted to chime in that I had the same problem on a WinXP install of:
python 2.7
Qt 4.7.1 (10.05)
PyQt 4.8.1
I used the windows installer version of all 3 of those items.
Copying the contents of the C:\Python27\Lib\site-packages\PyQt4\bin folder up to the main PyQt folder (C:\Python27\Lib\site-packages\PyQt4) s... | 5 | 11 | 0 | I've been trying to install PyQt 4.7 on Vista, but I am getting an ImportError when I try to do: from PyQt4 import QtCore, QtGui.
ImportError: DLL load failed: The specified module could not be found.
I've checked my System Path, and C:\Python31\Lib\site-packages\PyQt4\bin is on there.
I can't run any of the example... | PyQt 4.7 - ImportError after installing on Windows | 0.049958 | 0 | 0 | 24,135 |
2,140,836 | 2010-01-26T16:33:00.000 | 0 | 0 | 1 | 0 | python,windows,pyqt,importerror | 27,086,381 | 8 | false | 0 | 1 | I think there are at least two possible error conditions
1. ImportError: DLL load failed: The specified module could not be found.
then you have to check your PyQT version is comptible with your python. In other words, if you use python 3.3, then you can only use PyQT for python3.3 and python 3.3 will not work with PyQ... | 5 | 11 | 0 | I've been trying to install PyQt 4.7 on Vista, but I am getting an ImportError when I try to do: from PyQt4 import QtCore, QtGui.
ImportError: DLL load failed: The specified module could not be found.
I've checked my System Path, and C:\Python31\Lib\site-packages\PyQt4\bin is on there.
I can't run any of the example... | PyQt 4.7 - ImportError after installing on Windows | 0 | 0 | 0 | 24,135 |
2,140,836 | 2010-01-26T16:33:00.000 | 1 | 0 | 1 | 0 | python,windows,pyqt,importerror | 11,774,820 | 8 | false | 0 | 1 | I had the same problem. I got my program running from within Eclipse but when I tried running it directly from the command line I still got the same error.
I solved it by renaming the C:\Users\Me\AppData\Roaming\Python\Python27\site-packages\PyQt4 directory. (I'm guessing leftovers from a previous PyQt install)
I am us... | 5 | 11 | 0 | I've been trying to install PyQt 4.7 on Vista, but I am getting an ImportError when I try to do: from PyQt4 import QtCore, QtGui.
ImportError: DLL load failed: The specified module could not be found.
I've checked my System Path, and C:\Python31\Lib\site-packages\PyQt4\bin is on there.
I can't run any of the example... | PyQt 4.7 - ImportError after installing on Windows | 0.024995 | 0 | 0 | 24,135 |
2,140,836 | 2010-01-26T16:33:00.000 | 1 | 0 | 1 | 0 | python,windows,pyqt,importerror | 5,795,870 | 8 | false | 0 | 1 | Also chiming in. I installed both python 2.6 and PyQt 4.8.3 on a Windows 7 machine using the windows installers (I did NOT run 'python setup.py install').
I tried to run spyder (which requires PyQt 4.4 or greater) and failed because it couldn't find the PyQt .dlls. I copied all the .dlls from the \Lib\site-packages\PyQ... | 5 | 11 | 0 | I've been trying to install PyQt 4.7 on Vista, but I am getting an ImportError when I try to do: from PyQt4 import QtCore, QtGui.
ImportError: DLL load failed: The specified module could not be found.
I've checked my System Path, and C:\Python31\Lib\site-packages\PyQt4\bin is on there.
I can't run any of the example... | PyQt 4.7 - ImportError after installing on Windows | 0.024995 | 0 | 0 | 24,135 |
2,140,869 | 2010-01-26T16:38:00.000 | 3 | 0 | 1 | 0 | ironpython,.net-1.1 | 2,140,900 | 1 | true | 1 | 0 | IronPython since version 1.0 is only compatible with .NET 2.0 and higher, it uses Generic and features only available since .NET 2.0. | 1 | 1 | 0 | In IronPython Studio -> Properties -> General Tab i see a Property with Name Target Plataform and found Microsoft Framework 1.0, 1.1 and 2.0, selected 1.1 and next opened my Visual Studio 2003 -> Add Reference and for my surprise this not work. Not compatibility. Why? What i do wrong? | IronPython and Targetting to MS Framework 1.1 | 1.2 | 0 | 0 | 58 |
2,141,315 | 2010-01-26T17:39:00.000 | -2 | 0 | 1 | 0 | python,pygame | 2,141,369 | 2 | false | 0 | 1 | Pygame is an SDL wrapper. Not a multimedia framework. Why do you want to do audio format conversions in Pygame? Can't you use something else like maybe the gstreamer bindings for Python? | 1 | 3 | 0 | How can I convert a .wav file to some other format such as .mp3 in pygame?
Update:
Why not Gstreamer or Pygame:
I want to use native Windows environment to install a package that can do this (i.e. don't want to install cygwin). I am searching for a package which has a binary installer available for windows (with Pyth... | pygame saving audio files | -0.197375 | 0 | 0 | 410 |
2,141,589 | 2010-01-26T18:19:00.000 | 9 | 0 | 0 | 0 | python,postgresql,stored-procedures,plpgsql | 2,142,128 | 1 | true | 0 | 0 | Depends on what operations you're doing.
Well, combine that with a general Python documentation, and that's about what you have.
No. Again, depends on what you're doing. If you're only going to run a query once, no point in preparing it separately.
If you are using persistent connections, it might. But they get cleared... | 1 | 11 | 0 | we are still pretty new to Postgres and came from Microsoft Sql Server.
We are wanting to write some stored procedures now. Well, after struggling to get something more complicated than a hello world to work in pl/pgsql, we decided it's better if we are going to learn a new language we might as well learn Python becaus... | Stored Procedures in Python for PostgreSQL | 1.2 | 1 | 0 | 5,869 |
2,141,769 | 2010-01-26T18:50:00.000 | 0 | 0 | 0 | 0 | python,database,django,django-queryset | 4,230,081 | 3 | false | 1 | 0 | Actually, that didn't work out for me.
The following did:
Entry.objects.all().update(value=(F('value')==False)) | 1 | 7 | 0 | I have a queryset with a few million records. I need to update a Boolean Value, fundamentally toggle it, so that in the database table the values are reset. What's the fastest way to do that?
I tried traversing the queryset and updating and saving each record, that obviously takes ages? We need to do this very fast, an... | Fastest Way to Update a bunch of records in queryset in Django | 0 | 1 | 0 | 1,711 |
2,143,463 | 2010-01-26T23:19:00.000 | 0 | 0 | 0 | 0 | python,random,pygame | 64,776,255 | 4 | false | 0 | 1 | At the point when you want another level, you should initially create another levelRandom object, and give that object to a level-generator to produce the level (if you are using one) | 2 | 4 | 0 | I'm making a game which uses procedurally generated levels, and when I'm testing I'll often want to reproduce a level. Right now I haven't made any way to save the levels, but I thought a simpler solution would be to just reuse the seed used by Python's random module. However I've tried using both random.seed() and ran... | What's the easiest way to reproduce a randomly generated level in Python? | 0 | 0 | 0 | 2,510 |
2,143,463 | 2010-01-26T23:19:00.000 | 1 | 0 | 0 | 0 | python,random,pygame | 2,143,490 | 4 | false | 0 | 1 | Best would be to create a levelRandom class with a data slot for every randomly produced result when generating a level. Then separate the random-generation code from the level-construction code. When you want a new level, first generate a new levelRandom object, then hand that object to the level-generator to produce ... | 2 | 4 | 0 | I'm making a game which uses procedurally generated levels, and when I'm testing I'll often want to reproduce a level. Right now I haven't made any way to save the levels, but I thought a simpler solution would be to just reuse the seed used by Python's random module. However I've tried using both random.seed() and ran... | What's the easiest way to reproduce a randomly generated level in Python? | 0.049958 | 0 | 0 | 2,510 |
2,144,171 | 2010-01-27T02:21:00.000 | 1 | 0 | 1 | 1 | python,hadoop | 2,149,550 | 2 | false | 0 | 0 | If you're using Hadoop Streaming, your input can be in any line-based format; your mapper and reducer input comes from sys.stdin, which you read any way you want. You don't need to use the default tab-deliminated fields (although in my experience, one format should be used among all tasks for consistency when possible... | 1 | 3 | 0 | I'm using Hadoop for data processing with python, what file format should be used?
I have project with a substantial amount of text pages.
Each text file has some header information that I need to preserve during the processing; however, I don't want the headers to interfere with the clustering algorithms.
I'm using py... | I'm using Hadoop for data processing with python, what file format should be used? | 0.099668 | 0 | 0 | 1,633 |
2,145,232 | 2010-01-27T07:45:00.000 | 1 | 0 | 1 | 1 | python,windows | 2,145,311 | 6 | false | 0 | 0 | You don't say in your question what you are going to use Python for, so most answers above are completely correct in pointing out that you install Python by downloading it from Python.org. But you seem to expect more. Is it correct to assume you are going to use it to do web development?
In that case, prepare for a sho... | 2 | 2 | 0 | I am used to using PHP and it is easy to set up, I can just run an exe package like Xampp and have apache and PHP running in 5 minutes on my windows system. Is there something similar to Python? | How can I run Python code on a windows system? | 0.033321 | 0 | 0 | 1,021 |
2,145,232 | 2010-01-27T07:45:00.000 | 0 | 0 | 1 | 1 | python,windows | 2,145,253 | 6 | false | 0 | 0 | Download python installer and run python. | 2 | 2 | 0 | I am used to using PHP and it is easy to set up, I can just run an exe package like Xampp and have apache and PHP running in 5 minutes on my windows system. Is there something similar to Python? | How can I run Python code on a windows system? | 0 | 0 | 0 | 1,021 |
2,145,334 | 2010-01-27T08:16:00.000 | 0 | 0 | 1 | 0 | python,development-environment | 2,145,352 | 1 | true | 0 | 0 | It does not need to compile them, as it contains a Python interpreter already. | 1 | 1 | 0 | I want to develop an app for Moblin for a competition.
The development environment needed by Moblin is too complicated to setup. It uses Anjuta as its IDE, but I could never make sense of the entire compilation toolchain.
However, I would like to know if Moblin could compile and run Python scripts. If I could write the... | Can Moblin run (and compile) Python scripts? | 1.2 | 0 | 0 | 112 |
2,145,365 | 2010-01-27T08:23:00.000 | 1 | 1 | 0 | 0 | php,session,python-idle | 2,145,413 | 4 | false | 1 | 0 | I assume you mean 'idle' time. There is no need to calculate that, but you have to store the last (authenticated) access made by that user and reset the counter.
Typically, one would should issue an authentication cookie with a certain timestamp. Upon authentication of the cookie, you compare the current time with the ... | 4 | 1 | 0 | I would like to have my PHP website destroy a users session if they have been idle for 5 minutes. If this does happen, I'd like to present the user with a message stating why they were logged out and redirect them to the login page.
What is the best way to handle this?
I am running on php and myadmin.
Thanks
Avinash | How do I detect when a user has been idle for a certain time and destroy their session in PHP? | 0.049958 | 0 | 0 | 2,505 |
2,145,365 | 2010-01-27T08:23:00.000 | 1 | 1 | 0 | 0 | php,session,python-idle | 2,145,866 | 4 | false | 1 | 0 | Can you not just use PHP's built-in session functions to set session expiry time to 5 mins. and re-direct if a session no longer exists? | 4 | 1 | 0 | I would like to have my PHP website destroy a users session if they have been idle for 5 minutes. If this does happen, I'd like to present the user with a message stating why they were logged out and redirect them to the login page.
What is the best way to handle this?
I am running on php and myadmin.
Thanks
Avinash | How do I detect when a user has been idle for a certain time and destroy their session in PHP? | 0.049958 | 0 | 0 | 2,505 |
2,145,365 | 2010-01-27T08:23:00.000 | 7 | 1 | 0 | 0 | php,session,python-idle | 2,145,390 | 4 | true | 1 | 0 | Every time you load a page, store a timestamp in a session variable. When the user goes to a page, check to see if $SESSION['lastActivity'] < time() - <your idle time>. If true, then redirect to a 'your session has expired' page or similar. If not, continue loading the page. | 4 | 1 | 0 | I would like to have my PHP website destroy a users session if they have been idle for 5 minutes. If this does happen, I'd like to present the user with a message stating why they were logged out and redirect them to the login page.
What is the best way to handle this?
I am running on php and myadmin.
Thanks
Avinash | How do I detect when a user has been idle for a certain time and destroy their session in PHP? | 1.2 | 0 | 0 | 2,505 |
2,145,365 | 2010-01-27T08:23:00.000 | 0 | 1 | 0 | 0 | php,session,python-idle | 2,145,652 | 4 | false | 1 | 0 | Create a javascript function that has a x minute timeout that pops up and redirects.
Also on the server make sure their session expires so that in the case of Javascript not being available, they cannot continue actions after their idle time has passed. | 4 | 1 | 0 | I would like to have my PHP website destroy a users session if they have been idle for 5 minutes. If this does happen, I'd like to present the user with a message stating why they were logged out and redirect them to the login page.
What is the best way to handle this?
I am running on php and myadmin.
Thanks
Avinash | How do I detect when a user has been idle for a certain time and destroy their session in PHP? | 0 | 0 | 0 | 2,505 |
2,148,493 | 2010-01-27T16:20:00.000 | 4 | 0 | 0 | 0 | javascript,python,browser,screen-scraping | 2,148,595 | 5 | false | 1 | 0 | I have had to do this before (in .NET) and you are basically going to have to host a browser, get it to click the button, and then interrogate the DOM (document object model) of the browser to get at the generated HTML.
This is definitely one of the downsides to web apps moving towards an Ajax/Javascript approach to ge... | 1 | 18 | 0 | I need to scrape a site with python. I obtain the source html code with the urlib module, but I need to scrape also some html code that is generated by a javascript function (which is included in the html source). What this functions does "in" the site is that when you press a button it outputs some html code. How can ... | scrape html generated by javascript with python | 0.158649 | 0 | 1 | 17,188 |
2,148,994 | 2010-01-27T17:33:00.000 | 1 | 0 | 1 | 1 | python,command-line-arguments,python-idle | 65,991,396 | 12 | false | 0 | 0 | IDLE now has a GUI way to add arguments to sys.argv! Under the 'Run' menu header select 'Run... Customized' or just Shift+F5...A dialog will appear and that's it! | 3 | 44 | 0 | I'm testing some python code that parses command line input. Is there a way to pass this input in through IDLE? Currently I'm saving in the IDLE editor and running from a command prompt.
I'm running Windows. | When running a python script in IDLE, is there a way to pass in command line arguments (args)? | 0.016665 | 0 | 0 | 83,523 |
2,148,994 | 2010-01-27T17:33:00.000 | 1 | 0 | 1 | 1 | python,command-line-arguments,python-idle | 33,057,011 | 12 | false | 0 | 0 | Visual Studio 2015 has an addon for Python. You can supply arguments with that. VS 2015 is now free. | 3 | 44 | 0 | I'm testing some python code that parses command line input. Is there a way to pass this input in through IDLE? Currently I'm saving in the IDLE editor and running from a command prompt.
I'm running Windows. | When running a python script in IDLE, is there a way to pass in command line arguments (args)? | 0.016665 | 0 | 0 | 83,523 |
2,148,994 | 2010-01-27T17:33:00.000 | 0 | 0 | 1 | 1 | python,command-line-arguments,python-idle | 54,038,733 | 12 | false | 0 | 0 | import sys
sys.argv = [sys.argv[0], '-arg1', 'val1', '-arg2', 'val2']
//If you're passing command line for 'help' or 'verbose' you can say as:
sys.argv = [sys.argv[0], '-h'] | 3 | 44 | 0 | I'm testing some python code that parses command line input. Is there a way to pass this input in through IDLE? Currently I'm saving in the IDLE editor and running from a command prompt.
I'm running Windows. | When running a python script in IDLE, is there a way to pass in command line arguments (args)? | 0 | 0 | 0 | 83,523 |
2,149,358 | 2010-01-27T18:27:00.000 | 0 | 0 | 1 | 0 | python,dbus,asyncore | 2,154,293 | 3 | false | 0 | 0 | Although you got what is probably a perfectly reasonable answer, there is another approach - you don't need to use asyncore's loop per se. Just call asyncore.loop with a zero timeout and a count of 1, which stops it iterating (and thus makes the function name completely misleading) and polls the sockets just once. Call... | 2 | 6 | 0 | Is it possible to integrate asyncore with dbus through the same main loop?
Usually, DBus integration is done through glib main loop: is it possible to have either asyncore integrate this main loop or have dbus use asyncore's ? | Python asyncore & dbus | 0 | 0 | 0 | 764 |
2,149,358 | 2010-01-27T18:27:00.000 | 7 | 0 | 1 | 0 | python,dbus,asyncore | 2,149,387 | 3 | true | 0 | 0 | asyncore sucks. glib already provides async stuff, so just use glib's mainloop to do everything. | 2 | 6 | 0 | Is it possible to integrate asyncore with dbus through the same main loop?
Usually, DBus integration is done through glib main loop: is it possible to have either asyncore integrate this main loop or have dbus use asyncore's ? | Python asyncore & dbus | 1.2 | 0 | 0 | 764 |
2,150,144 | 2010-01-27T20:49:00.000 | 2 | 0 | 1 | 0 | python,multithreading | 18,595,947 | 7 | false | 0 | 0 | A very glib one-word response: Golang. | 4 | 6 | 0 | just considering starting to learning python but I have one concern before I invest more time. Let me phrase this as a statement followed by a concern for others to comment on as perhaps the assumptions in the statement are invalid:
I have read about GIL and the consensus seems to be if you require concurrent solutions... | Is python a serious option for concurrent programming | 0.057081 | 0 | 0 | 5,247 |
2,150,144 | 2010-01-27T20:49:00.000 | 1 | 0 | 1 | 0 | python,multithreading | 8,353,250 | 7 | false | 0 | 0 | writing codes for multiple process is not an easy task.
But if you start thinking to this way first, eventually, it is easier to scale if one machine isn't enough...Threads can't be used across machines... | 4 | 6 | 0 | just considering starting to learning python but I have one concern before I invest more time. Let me phrase this as a statement followed by a concern for others to comment on as perhaps the assumptions in the statement are invalid:
I have read about GIL and the consensus seems to be if you require concurrent solutions... | Is python a serious option for concurrent programming | 0.028564 | 0 | 0 | 5,247 |
2,150,144 | 2010-01-27T20:49:00.000 | 1 | 0 | 1 | 0 | python,multithreading | 2,150,247 | 7 | false | 0 | 0 | If you're considering learning Python for addressing this problem, I might suggest taking a look at Erlang instead. It has excellent support for very lightweight processes, and built-in primitives for IPC.
Not to discourage you from learning Python, of course, just suggesting there might be a better tool for this part... | 4 | 6 | 0 | just considering starting to learning python but I have one concern before I invest more time. Let me phrase this as a statement followed by a concern for others to comment on as perhaps the assumptions in the statement are invalid:
I have read about GIL and the consensus seems to be if you require concurrent solutions... | Is python a serious option for concurrent programming | 0.028564 | 0 | 0 | 5,247 |
2,150,144 | 2010-01-27T20:49:00.000 | 3 | 0 | 1 | 0 | python,multithreading | 2,150,156 | 7 | false | 0 | 0 | In my limited experience, the "context switch cost" is overrated as a performance limitation.
I/O bandwidth and memory are the most common limiting factors. Python's I/O is comparable to many other languages, since it simply uses the standard C libraries pretty directly.
Your actual problem may not be typical. Howeve... | 4 | 6 | 0 | just considering starting to learning python but I have one concern before I invest more time. Let me phrase this as a statement followed by a concern for others to comment on as perhaps the assumptions in the statement are invalid:
I have read about GIL and the consensus seems to be if you require concurrent solutions... | Is python a serious option for concurrent programming | 0.085505 | 0 | 0 | 5,247 |
2,150,899 | 2010-01-27T22:46:00.000 | -1 | 0 | 0 | 0 | python,menu,gtk,pygtk | 2,152,012 | 2 | false | 0 | 1 | Try digging into source and it's documentation. I have found this to be the easiest way and best shortcut. | 1 | 6 | 0 | Using Python and PyGTK I've got a GtkMenu with various GtkCheckMenuItems in it. When the user clicks one of the checkboxes the menu closes. I'd like for the user to be able to check a series of checkboxes without the menu closing each time.
I've looked at using the activate callback to show the menu but this doesn't s... | Making a Python/GTK CheckMenuItem, when clicked, not close the menu | -0.099668 | 0 | 0 | 749 |
2,150,947 | 2010-01-27T22:55:00.000 | 3 | 1 | 0 | 0 | php,python,wordpress,deployment,hosting | 2,150,982 | 1 | true | 1 | 0 | As far as points #1 and #2 go, you are probably right. No other platform is so widely, easily and cheaply available in terms of hosting companies and packages like the LAMP stack. Plus, most incompatibilities that can occur when deploying an application to a completely unknown web space are well documented, their numbe... | 1 | 3 | 0 | My own answer to this question is YES, but I'd like to hear from others. Put another way the question could be: Would the success of 1-click-install WordPress (not WordPress.com, which is SaaS) be possible if it weren't written in PHP, all other things being equal?
The critical associated requirements I believe suppor... | Is PHP the only choice re: massive and rapid uptake of a re-deployable, extensible web application? | 1.2 | 0 | 0 | 181 |
2,152,098 | 2010-01-28T03:24:00.000 | 7 | 0 | 0 | 0 | python,screen-scraping,mechanize | 2,167,177 | 1 | true | 1 | 0 | The answer to my immediate question in the headline is yes, with mechanize.Browser.open_novisit(). It works just like open(), but it doesn't change the state of the Browser instance -- that is, it will retrieve the page, and your Browser object will stay where it was. | 1 | 3 | 0 | In Python's mechanize.Browser module, when you submit a form the browser instance goes to that page. For this one request, I don't want that; I want it just to stay on the page it's currently on and give me the response in another object (for looping purposes). Anyone know a quick to do this?
EDIT:
Hmm, so I have this ... | Can I get my instance of mechanize.Browser to stay on the same page after calling b.form.submit()? | 1.2 | 0 | 1 | 1,070 |
2,152,471 | 2010-01-28T05:19:00.000 | 4 | 1 | 0 | 0 | python,linux,datetime,timezone | 2,152,511 | 3 | true | 0 | 0 | You can use time.gmtime() to get time GMT (UTC) from any machine no matter the timezone, then you can apply your offset. | 1 | 5 | 0 | I need to know the current time at CDT when my Python script is run. However this script will be run in multiple different timezones so a simple offset won't work.
I only need a solution for Linux, but a cross platform solution would be ideal. | how to find time at particular timezone from anywhere | 1.2 | 0 | 0 | 1,946 |
2,154,946 | 2010-01-28T13:55:00.000 | 0 | 0 | 1 | 0 | python,algorithm,list,linked-list | 11,097,246 | 10 | false | 0 | 0 | How about using any of data structures which provide sorted data access? Binary (AVL trees, AVL, Red-black), for instance? These guarantee O(log(N)) insertion complexity. Not O(1), but better than what you have. | 2 | 8 | 0 | I am looking for a linked list and related algorithms implementation for Python. Everyone I ask just recommends using built in Python lists, but performance measurements indicate that list insertion and removal is a bottleneck for our application. It's trivial to implement a simple linked list, but I wonder if there is... | Python linked list O(1) insert/remove | 0 | 0 | 0 | 17,260 |
2,154,946 | 2010-01-28T13:55:00.000 | 1 | 0 | 1 | 0 | python,algorithm,list,linked-list | 4,052,959 | 10 | false | 0 | 0 | For large data, keep a sorted list is a trick. Don't insert but append new items at the end and then sort it. Don't delet item but replace with a special value, sort them to the end and then pop out. For finding, a sorted list also has very quick performance with bisection method. As for small data, iterate old list, f... | 2 | 8 | 0 | I am looking for a linked list and related algorithms implementation for Python. Everyone I ask just recommends using built in Python lists, but performance measurements indicate that list insertion and removal is a bottleneck for our application. It's trivial to implement a simple linked list, but I wonder if there is... | Python linked list O(1) insert/remove | 0.019997 | 0 | 0 | 17,260 |
2,155,042 | 2010-01-28T14:11:00.000 | 1 | 0 | 1 | 1 | python,windows,process | 2,155,073 | 2 | false | 0 | 0 | You could use py2exe to turn your Python program into a self-contained executable with whatever name that you choose to give it. | 1 | 11 | 0 | Windows Task Manager lists all running processes in the "Processes" tab.
The image name of Python scripts is always python.exe, or pythonw.exe, or the name of the Python interpreter.
Is there a nice way to change the image name of a Python script, other than changing the name of the Python interpreter? | Change process name of Python script | 0.099668 | 0 | 0 | 5,268 |
2,155,509 | 2010-01-28T15:14:00.000 | 6 | 0 | 0 | 0 | python,networking,encryption,cryptography,twisted | 2,155,905 | 2 | true | 0 | 0 | The protocol you described addresses one attack, that is the a replay attack. However, you are very vulnerable to MITM attacks. The TCP connection won't drop when the attacker moves in on the protocol. Further more anything transferred over this system can be sniffed. If you are on the wireless at a cafe everyone ... | 1 | 5 | 0 | I wasn't sure how to phrase this question, so apologies in advance if it's a duplicate of something else.
I wanted to sanity check how I've secured my twisted based application and think I've done a good job at it, but it's been over a decade since I've written anything that uses raw or managed sockets.
Authentication ... | Basics of string based protocol security | 1.2 | 0 | 0 | 797 |
2,156,559 | 2010-01-28T17:35:00.000 | 0 | 0 | 0 | 0 | python,django,xapian,django-haystack | 18,338,048 | 5 | false | 1 | 0 | For solr backend I need to use _exact (just one underline instead of two). | 3 | 5 | 0 | I have a haystack search which has the following SearchIndex:
class GrantIndex(indexes.SearchIndex):
"""
This provides the search index for the Grant application.
"""
text = indexes.CharField(document=True, use_template=True)
year = indexes.IntegerField(model_attr='year__year')
date = indexes.D... | Django Haystack exact filtering | 0 | 0 | 0 | 2,527 |
2,156,559 | 2010-01-28T17:35:00.000 | 3 | 0 | 0 | 0 | python,django,xapian,django-haystack | 2,990,433 | 5 | false | 1 | 0 | You've problably solved the problem already, but I just stumbled over the same problem with the Whoosh backend. Maybe the Xapian and Whoosh backends behave the same? Seems Whoosh is stemming all CharFields by default, and searching inside them with some kind of contains-query. Switching to a custom backend, without ste... | 3 | 5 | 0 | I have a haystack search which has the following SearchIndex:
class GrantIndex(indexes.SearchIndex):
"""
This provides the search index for the Grant application.
"""
text = indexes.CharField(document=True, use_template=True)
year = indexes.IntegerField(model_attr='year__year')
date = indexes.D... | Django Haystack exact filtering | 0.119427 | 0 | 0 | 2,527 |
2,156,559 | 2010-01-28T17:35:00.000 | 0 | 0 | 0 | 0 | python,django,xapian,django-haystack | 8,370,572 | 5 | false | 1 | 0 | use "prepare_data" for program field and get rid of health\blabla things | 3 | 5 | 0 | I have a haystack search which has the following SearchIndex:
class GrantIndex(indexes.SearchIndex):
"""
This provides the search index for the Grant application.
"""
text = indexes.CharField(document=True, use_template=True)
year = indexes.IntegerField(model_attr='year__year')
date = indexes.D... | Django Haystack exact filtering | 0 | 0 | 0 | 2,527 |
2,157,208 | 2010-01-28T19:13:00.000 | 3 | 0 | 1 | 0 | python,gil | 2,157,256 | 2 | false | 0 | 0 | Yes, multithreading without locking almost always causes problems, with or without a GIL. | 1 | 4 | 0 | In python, I have a global variable defined that gets read/incremented by different threads. Because of the GIL, will this ever cause problems without using any kind of locking mechanism? | Python GIL and globals | 0.291313 | 0 | 0 | 610 |
2,159,901 | 2010-01-29T04:38:00.000 | -1 | 0 | 0 | 1 | python,ide,editor,autocomplete,wxpython | 2,159,924 | 8 | false | 0 | 0 | try use brain to autocomplete... :)
just joking. when I coding in in PyQt4, I open qt-assistant and search the manual,
and wrap myclass like : MyButton = QPusuButton
I think it is impossible to use autocomplete in python,
because only in runtime the computer know what happens. | 4 | 0 | 0 | What editors or IDEs offer decent autocompletion for wxPython on Windows or Linux? Are there any? I tried several and support is either non-existant or limited. | wxPython autocomplete | -0.024995 | 0 | 0 | 1,719 |
2,159,901 | 2010-01-29T04:38:00.000 | 0 | 0 | 0 | 1 | python,ide,editor,autocomplete,wxpython | 2,160,186 | 8 | false | 0 | 0 | Whatever the default windows IDE for Python is can autocomplete, with code not from the standard library. | 4 | 0 | 0 | What editors or IDEs offer decent autocompletion for wxPython on Windows or Linux? Are there any? I tried several and support is either non-existant or limited. | wxPython autocomplete | 0 | 0 | 0 | 1,719 |
2,159,901 | 2010-01-29T04:38:00.000 | 1 | 0 | 0 | 1 | python,ide,editor,autocomplete,wxpython | 2,160,555 | 8 | false | 0 | 0 | I use Eclipse/PyDev for wxPython development. I've been very satisfied with Eclipse for Python development productivity. It does have support for autocompletion for wxPython. | 4 | 0 | 0 | What editors or IDEs offer decent autocompletion for wxPython on Windows or Linux? Are there any? I tried several and support is either non-existant or limited. | wxPython autocomplete | 0.024995 | 0 | 0 | 1,719 |
2,159,901 | 2010-01-29T04:38:00.000 | 1 | 0 | 0 | 1 | python,ide,editor,autocomplete,wxpython | 31,372,616 | 8 | false | 0 | 0 | I'm partial to PyCharm. However, most IDEs will auto complete code based on what modules you've imported, so it's not specific to PyCharm. | 4 | 0 | 0 | What editors or IDEs offer decent autocompletion for wxPython on Windows or Linux? Are there any? I tried several and support is either non-existant or limited. | wxPython autocomplete | 0.024995 | 0 | 0 | 1,719 |
2,161,197 | 2010-01-29T10:13:00.000 | 2 | 1 | 0 | 0 | python,sms,at-command | 2,161,275 | 4 | false | 0 | 0 | Talking to the phone is easy. You just need to open the appropriate /dev/ttyACM* device and talk to it. Which phone is trickier. Any phone that supports "tethering" and the full AT command set for SMS messages should be fine. | 2 | 13 | 0 | Can anyone help me to send and receive SMS using AT commands in Python?
In case it matters, I'm using Fedora 8.
Which phone will be better with Linux (Nokia, Sony Ericson, Samsung,.....)?
Will all phones support sending and receiving SMS using AT commands? | How to Send/Receive SMS using AT commands? | 0.099668 | 0 | 0 | 53,296 |
2,161,197 | 2010-01-29T10:13:00.000 | 1 | 1 | 0 | 0 | python,sms,at-command | 48,543,135 | 4 | false | 0 | 0 | I would suggest replace the time.sleep with condition loop waiting for the response from the modem "OK" before continue next state. | 2 | 13 | 0 | Can anyone help me to send and receive SMS using AT commands in Python?
In case it matters, I'm using Fedora 8.
Which phone will be better with Linux (Nokia, Sony Ericson, Samsung,.....)?
Will all phones support sending and receiving SMS using AT commands? | How to Send/Receive SMS using AT commands? | 0.049958 | 0 | 0 | 53,296 |
2,161,778 | 2010-01-29T12:13:00.000 | 1 | 0 | 0 | 0 | python,wsgi | 2,270,464 | 7 | false | 1 | 0 | Also, you missed web.py, which is both small and supports code reload. | 4 | 11 | 0 | From what I can tell
wsgiref - no code reload
CherryPy - more than just the server
mod_wsgi - all the apache overhead
paste.httpserver - paste is a huge package with other stuff in it
flup - same as paste, too much stuff.
Spawning - never used it but seems lightweight enough.
Tornado - not really wsgi + full "framewor... | which is a minimalistic python wsgi development server with support for code reload? | 0.028564 | 0 | 0 | 4,339 |
2,161,778 | 2010-01-29T12:13:00.000 | 1 | 0 | 0 | 0 | python,wsgi | 2,161,869 | 7 | false | 1 | 0 | So far I've been using CherryPy, and compared to Django (which, while not in your list, is the only other dev server I used) I like it heaps more. It does what is says: it is only there when you need it, and gets out of the way for the rest of the time.
Using Django seemed like I needed to subscribe to the Django way o... | 4 | 11 | 0 | From what I can tell
wsgiref - no code reload
CherryPy - more than just the server
mod_wsgi - all the apache overhead
paste.httpserver - paste is a huge package with other stuff in it
flup - same as paste, too much stuff.
Spawning - never used it but seems lightweight enough.
Tornado - not really wsgi + full "framewor... | which is a minimalistic python wsgi development server with support for code reload? | 0.028564 | 0 | 0 | 4,339 |
2,161,778 | 2010-01-29T12:13:00.000 | 1 | 0 | 0 | 0 | python,wsgi | 2,161,981 | 7 | false | 1 | 0 | I'd recommend paste or CherryPy. They're the easiest to get up and running with. | 4 | 11 | 0 | From what I can tell
wsgiref - no code reload
CherryPy - more than just the server
mod_wsgi - all the apache overhead
paste.httpserver - paste is a huge package with other stuff in it
flup - same as paste, too much stuff.
Spawning - never used it but seems lightweight enough.
Tornado - not really wsgi + full "framewor... | which is a minimalistic python wsgi development server with support for code reload? | 0.028564 | 0 | 0 | 4,339 |
2,161,778 | 2010-01-29T12:13:00.000 | 0 | 0 | 0 | 0 | python,wsgi | 2,270,443 | 7 | false | 1 | 0 | You can use paste.reloader with any wsgi-server, aside of other paste modules.
# run paste reloader
import paste.reloader as reloader
reloader.install()
# run wsgiref server
from wsgiref import simple_server
simple_server.make_server('', 8080, main_wsgi_app).serve_forever()
Is that minimalistic enough? | 4 | 11 | 0 | From what I can tell
wsgiref - no code reload
CherryPy - more than just the server
mod_wsgi - all the apache overhead
paste.httpserver - paste is a huge package with other stuff in it
flup - same as paste, too much stuff.
Spawning - never used it but seems lightweight enough.
Tornado - not really wsgi + full "framewor... | which is a minimalistic python wsgi development server with support for code reload? | 0 | 0 | 0 | 4,339 |
2,163,765 | 2010-01-29T17:26:00.000 | 0 | 0 | 1 | 0 | python,probability | 2,163,823 | 2 | false | 0 | 0 | explain better your problem, what operations and what elements you're focusing?
regarding the problem with the elements beeing chosen more often, give each string an "chance multiplier", each comparison you multiply a number between 1 and 10 and the chance multiplyer of the string, if the result is higher than X (say..... | 1 | 2 | 0 | Let's say I have a list in python with several strings in it. I do not know the size. How can I run a loop to do an operation on 2 random elements of this string?
What if I wanted to favour a certain subset of the strings in this randomization, to be selected more often, but still make it possible for them to not b... | How can I run a loop against 2 random elements from a list at a time? | 0 | 0 | 0 | 147 |
2,165,172 | 2010-01-29T21:09:00.000 | 22 | 0 | 1 | 0 | python | 2,165,206 | 6 | true | 0 | 0 | Python strings are immutable, which means that they do not support item or slice assignment. You'll have to build a new string using i.e. someString[:3] + 'a' + someString[4:] or some other suitable approach. | 2 | 16 | 0 | In python, are strings mutable? The line someString[3] = "a" throws the error
TypeError: 'str' object does not
support item assignment
I can see why (as I could have written someString[3] = "test" and that would obviously be illegal) but is there a method to do this in python? | Replacing one character of a string in python | 1.2 | 0 | 0 | 20,916 |
2,165,172 | 2010-01-29T21:09:00.000 | 4 | 0 | 1 | 0 | python | 2,165,263 | 6 | false | 0 | 0 | In new enough pythons you can also use the builtin bytearray type, which is mutable. See the stdlib documentation. But "new enough" here means 2.6 or up, so that's not necessarily an option.
In older pythons you have to create a fresh str as mentioned above, since those are immutable. That's usually the most readable a... | 2 | 16 | 0 | In python, are strings mutable? The line someString[3] = "a" throws the error
TypeError: 'str' object does not
support item assignment
I can see why (as I could have written someString[3] = "test" and that would obviously be illegal) but is there a method to do this in python? | Replacing one character of a string in python | 0.132549 | 0 | 0 | 20,916 |
2,165,200 | 2010-01-29T21:13:00.000 | 1 | 0 | 1 | 0 | python,metaclass | 2,165,257 | 4 | false | 0 | 0 | You can't edit the class directly like you might with javascript's prototype attribute, it's better if you subclass them. This let's you add the functionality you want and not force it to be used everywhere. | 2 | 3 | 0 | I'd like to modify all classes in Python. For example str and int and others like Person(object).
I'd like to add an attribute to them and to change the way its methods works.
Which is the best approach for this? Metaclasses? | Modifying a Python class | 0.049958 | 0 | 0 | 4,189 |
2,165,200 | 2010-01-29T21:13:00.000 | 3 | 0 | 1 | 0 | python,metaclass | 2,165,399 | 4 | false | 0 | 0 | While you can do this for classes defined in python code (it will not work for builtin ones) by reassigning their attributes please do not actually do so. Just subclass and use the subclass, or write functions that take an instance of the class as argument instead of adding your own methods. Doing what you have to mind... | 2 | 3 | 0 | I'd like to modify all classes in Python. For example str and int and others like Person(object).
I'd like to add an attribute to them and to change the way its methods works.
Which is the best approach for this? Metaclasses? | Modifying a Python class | 0.148885 | 0 | 0 | 4,189 |
2,165,517 | 2010-01-29T22:08:00.000 | 0 | 1 | 0 | 0 | python,hotmail | 2,458,380 | 3 | false | 0 | 0 | use octazen, but you have to pay for it | 1 | 2 | 0 | How can I retrieve contacts from hotmail with python?
Is there any example? | How do I retrieve Hotmail contacts with python | 0 | 0 | 1 | 1,864 |
2,168,409 | 2010-01-30T15:47:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine,facebook,macos | 29,235,036 | 5 | false | 1 | 0 | In Android Studio with Google App Engine plugin.
Just add httpAddress = '0.0.0.0' to app cfg in build.grade file. | 1 | 10 | 0 | Can access AppEngine SDK sites via local ip-address when localhost works just fine and a MacOSX using the GoogleAppEngineLauncher.
I'm trying to setup facebook development site (using a dyndns.org hostname pointing at my firewall which redirects the call to my mac book).
It seems like GoogleAppEngineLauncher defaults t... | Can access AppEngine SDK sites via local ip-address when localhost works just fine and a MacOSX | 0 | 0 | 0 | 6,718 |
2,168,793 | 2010-01-30T17:48:00.000 | 0 | 0 | 1 | 0 | python,nlp,nltk | 2,226,080 | 3 | false | 0 | 0 | Alex is right, start with the docs, and figure out which corpus reader will work for your corpus. The simple instantiate it, given the path to your corpus file(s). As you'll see in the docs, the builtin corpora are simply instances of particular corpus reader classes. Look thru the code in the nltk.corpus package shoul... | 2 | 4 | 0 | I have recently expanded the names corpus in nltk and would like to know how I can turn the two files I have (male.txt, female.txt) in to a corpus so I can access them using the existing nltk.corpus methods. Does anyone have any suggestions?
Many thanks,
James. | How can I create my own corpus in the Python Natural Language Toolkit? | 0 | 0 | 0 | 6,842 |
2,168,793 | 2010-01-30T17:48:00.000 | 1 | 0 | 1 | 0 | python,nlp,nltk | 2,355,858 | 3 | false | 0 | 0 | Came to understand how corpus reading works by looking at the source code in nltk.corpus and then looking at the corpora (located in /home/[user]/nltk_data/corpora/names - this will probably be in My Documents for XP and somewhere in User for Win7 users).
The structure of the corpus and its related function will give a... | 2 | 4 | 0 | I have recently expanded the names corpus in nltk and would like to know how I can turn the two files I have (male.txt, female.txt) in to a corpus so I can access them using the existing nltk.corpus methods. Does anyone have any suggestions?
Many thanks,
James. | How can I create my own corpus in the Python Natural Language Toolkit? | 0.066568 | 0 | 0 | 6,842 |
2,169,449 | 2010-01-30T21:12:00.000 | 0 | 0 | 0 | 0 | python,mysql,c | 2,169,464 | 2 | false | 0 | 0 | It's the adaptor that sits between the Python MySQLdb module and the C libmysqlclient library. One of the most common reasons for it not loading is that the appropriate libmysqlclient library is not in place. | 1 | 1 | 0 | Why is _mysql in the MySQLdb module a C file? When the module tries to import it, I get an import error. What should I do? | Importing _mysql in MySQLdb | 0 | 1 | 0 | 1,242 |
2,170,990 | 2010-01-31T08:01:00.000 | 0 | 1 | 0 | 0 | python,authentication,mediawiki | 2,456,365 | 5 | false | 1 | 0 | All you need to do is essentially forward the session, cookies and all, to the API as if it's the user querying.
How would one go about doing that? I can access the API directly and see my login info, but if I access it via PHP, it shows me as not being logged in (anonymous user id "0"). How do I forward the session, ... | 1 | 4 | 0 | Here is the situation:
I have a Mediawiki installation, and a few additional server-side scripts that require more resources and were already written in a different language (python). The python code will be very loosely coupled with the Mediawiki code (only called by clicking on a link here or there)
What I would like... | How to check if a user is logged on in mediawiki in a different app? | 0 | 0 | 0 | 4,553 |
2,171,072 | 2010-01-31T08:45:00.000 | 0 | 0 | 0 | 0 | python,mysql | 2,171,104 | 2 | false | 0 | 0 | It looks like query is formed with wrong syntax.
Could you display string parameter of cursor.execute? | 1 | 0 | 0 | I am attempting to execute the following query via the mysqldb module in python:
for i in self.p.parameter_type:
cursor.execute("""UPDATE parameters SET %s = %s WHERE parameter_set_name = %s""" % (i,
float(getattr(self.p, i)), self.list_box_parameter.GetStringSelection()))
I keep getting the error: "... | Trouble with MySQL UPDATE syntax with the module mysqldb in Python | 0 | 1 | 0 | 375 |
2,171,746 | 2010-01-31T13:07:00.000 | 0 | 0 | 0 | 0 | python,module,pygame | 2,176,010 | 2 | false | 0 | 1 | I assumed that my python C module can
access pygame stuff directly in C. Is
this the case?
No, that stuff is most likely just there because it was necessary to compile the pygame Python extension.
I don't understand what you mean when you say you see 2 pygame instances. There are as many instances as you create, n... | 1 | 1 | 0 | In my Python2_6/include directory is a folder with pygame headers. I assumed that my python C module can access pygame stuff directly in C. Is this the case? How do I integrate a C module that wants to use pygame, with a python script using pygame? Right now my brain sees:
pygame <-- MyCModule <-- MyScript --> pygame
i... | Integrating pygame with a C module | 0 | 0 | 0 | 390 |
2,171,820 | 2010-01-31T13:32:00.000 | 3 | 0 | 0 | 0 | python,django,django-admin | 2,171,917 | 2 | false | 1 | 0 | +1 for custom app, hacking admin can take more time than just putting together your own admin from generic views. | 1 | 4 | 0 | I'm building a simple app, a sort of project/tasks manager where I can have several projects and several tasks that are assigned to one project.
I enabled Django admin for all this sort of tasks and it's working like a charm. Also, I have some users that have projects assigned to them. So what I want now is to enable a... | How to implement a client admin in Django? | 0.291313 | 0 | 0 | 537 |
2,171,902 | 2010-01-31T13:58:00.000 | 0 | 0 | 0 | 1 | python,datetime,time,licensing | 2,171,940 | 3 | false | 0 | 0 | Nearly every standard function will return the machine time that can be adjusted by the user.
One possibility is to call a web service that returns the "correct" time. But this is only possible if you can assume internet access.
And may be should ask your self the question if that hassle is really worth the effort? | 1 | 2 | 0 | I'm searching for a way to generate a (limited time license) .so
when a user starts the program . it has to check license date first before the program runs.
but the problem is :
i tried a couple of solutions . one of them is python's time.ctime , (to check time and see if it's realy during the license time) and it ret... | python how to -generate license- using time module | 0 | 0 | 0 | 1,108 |
2,173,212 | 2010-01-31T20:37:00.000 | 1 | 1 | 0 | 0 | eclipse,unit-testing,pydev,python-unittest | 2,220,154 | 3 | false | 0 | 0 | Go to the preferences and type in keys to get to the keyboard shortcut definition page (I think it's called keys... sorry not on my dev machine right now). In this dialog you can search for commands. See if there is a run all tests command (it might help to find the run tests you are currently using first). If there... | 1 | 7 | 0 | I know Ctrl + F9 runs a single file.
How to run them all?
If there is no such thing, how to bind one keyboard shortcut to it? | What is the keyboard shortcut to run all unit tests in the current project in PyDev + Eclipse? | 0.066568 | 0 | 0 | 5,179 |
2,173,985 | 2010-02-01T00:15:00.000 | 2 | 0 | 1 | 0 | python,windows-7,numpy,windows-7-x64 | 2,182,498 | 3 | true | 0 | 0 | Numpy is not supported on python 2.5 for Windows 64 bits, you need at least python 2.6, and even in that case, you need to build it by yourself, or use something like EPD or the installer given in link given by thor.
NumPy cannot be used in Google App Engine, so I am not sure to understand the argument there. | 1 | 4 | 0 | NumPy installer can't find python path in the registry.
Cannot install
Python version 2.5 required, which was not found in the registry.
OK
I have to modify the registry?
I already modified %PATH% to point to the Python25 installation directory. | How to install NumPy on Windows 64? | 1.2 | 0 | 0 | 21,387 |
2,174,015 | 2010-02-01T00:27:00.000 | 2 | 0 | 1 | 0 | python,regex,nested,expression | 2,174,057 | 6 | false | 0 | 0 | Either a table-driven parser as Alex Martelli suggests or a hand-written recursive descent parser. They're not hard and quite rewarding to write. | 1 | 3 | 0 | I am using Python 2.6.4.
I have a series of select statements in a text file and I need to extract the field names from each select query. This would be easy if some of the fields didn't use nested functions like to_char() etc.
Given select statement fields that could have several nested parenthese like "ltrim(rtrim(... | recursive nested expression in Python | 0.066568 | 0 | 0 | 2,080 |
2,174,873 | 2010-02-01T05:43:00.000 | 0 | 0 | 0 | 0 | python,coding-style,tabs,pygtk | 2,786,548 | 2 | false | 0 | 1 | Just for the record, if you are going to create something similar to a gtk.Notebook, I'll recomment you to subclass gtk.Notebook to save a lot of work. | 2 | 1 | 0 | I'm writing a program and I need some extra functionality from the gtk.Notebook widget, so I have taken to creating my own.
My only problem is styling my tabs so that they look like the tabs in gtk.Notebook and will change according to the user's theme.
I really don't know where to start so any advice would be much app... | PyGTK: How do I make a custom widget look like a gtk.Notebook tab? | 0 | 0 | 0 | 682 |
2,174,873 | 2010-02-01T05:43:00.000 | 0 | 0 | 0 | 0 | python,coding-style,tabs,pygtk | 2,212,682 | 2 | true | 0 | 1 | I solved the problem eventually by getting the colours from gtk.Notebook's style. | 2 | 1 | 0 | I'm writing a program and I need some extra functionality from the gtk.Notebook widget, so I have taken to creating my own.
My only problem is styling my tabs so that they look like the tabs in gtk.Notebook and will change according to the user's theme.
I really don't know where to start so any advice would be much app... | PyGTK: How do I make a custom widget look like a gtk.Notebook tab? | 1.2 | 0 | 0 | 682 |
2,174,904 | 2010-02-01T05:50:00.000 | 0 | 0 | 0 | 0 | python,eclipse,wxpython | 2,182,198 | 3 | false | 0 | 1 | The best kludge I found was the Kubuntu global shortcut "Ctrl-Shift-Space". This moves a window to the other screen, mitigating the hassle of dragging with the mouse. | 2 | 0 | 0 | I currently have a dual-monitor setup with Eclipse on monitor 2. When I run the code that launches the wxPython GUI, I would like for this GUI to appear on monitor 1. Currently, the GUI consistently appears on monitor 2, covering Eclipse, and I have to drag it to monitor 1 every time. Is there a solution to this proble... | Making wxPython GUI launch on a different screen from Eclipse | 0 | 0 | 0 | 441 |
2,174,904 | 2010-02-01T05:50:00.000 | 0 | 0 | 0 | 0 | python,eclipse,wxpython | 2,189,730 | 3 | true | 0 | 1 | Kludge #2: If I run the code from Eclipse on screen 2 then click someplace on screen 1 before the GUI appears, the GUI will appear on screen 1. | 2 | 0 | 0 | I currently have a dual-monitor setup with Eclipse on monitor 2. When I run the code that launches the wxPython GUI, I would like for this GUI to appear on monitor 1. Currently, the GUI consistently appears on monitor 2, covering Eclipse, and I have to drag it to monitor 1 every time. Is there a solution to this proble... | Making wxPython GUI launch on a different screen from Eclipse | 1.2 | 0 | 0 | 441 |
2,175,377 | 2010-02-01T08:13:00.000 | 0 | 0 | 0 | 0 | python,django,cherokee,scgi | 2,236,822 | 1 | false | 1 | 0 | I dropped all tables from the database, upgraded to last version of django-mingus after having deleted some dependencies to get them clean installed and I launched the scgi process using a shell script that activate the virtual environment before.
Now everything seems to be stable. | 1 | 1 | 0 | I have a django-mingus blog running perfectly fine with the integrated development web server of django. It's installed in a virtualenv.
Once deployed using the django app wizard of cherokee 0.99.42 the admin pannel is displaying a strange behaviour. Sometimes all apps are displayed in the admin pannel sometime only a ... | Problem deploying Django-Mingus with Flup and Cherokee. Strange admin behaviour | 0 | 0 | 0 | 298 |
2,175,573 | 2010-02-01T09:01:00.000 | 0 | 1 | 1 | 0 | python,cocoa,macos,pyobjc | 2,176,578 | 8 | false | 0 | 0 | You're going to need Objective-C: that's what all the tutorials, documentation, sample code, and everything is written in. In addition to a wilder variety of people being able to help you.
So learn ObjC first. If, on your second or third project, or a year down the road, you start a project that needs a Python module (... | 3 | 13 | 0 | I know some Python and I'm really impressed by the language's ease of use. From what I've seen of Objective-C it looks a lot less pretty, but it seems to be the lingua franca for Mac OS X development (which means it has better documentation).
I'm thinking about starting Mac development - will using PyObjC+Python make ... | What are the downsides of using Python instead of Objective-C? | 0 | 0 | 0 | 3,245 |
2,175,573 | 2010-02-01T09:01:00.000 | 2 | 1 | 1 | 0 | python,cocoa,macos,pyobjc | 2,175,875 | 8 | false | 0 | 0 | Second class citizen seems a bit strong. The Objective-C API's are available from Python as well, should you need them, and that's mostly if you want to make Cocoa apps. But then they are restricted to OS X anyway. Personally, I have no interest in building apps that isn't cross-platform, but that's me. That also means... | 3 | 13 | 0 | I know some Python and I'm really impressed by the language's ease of use. From what I've seen of Objective-C it looks a lot less pretty, but it seems to be the lingua franca for Mac OS X development (which means it has better documentation).
I'm thinking about starting Mac development - will using PyObjC+Python make ... | What are the downsides of using Python instead of Objective-C? | 0.049958 | 0 | 0 | 3,245 |
2,175,573 | 2010-02-01T09:01:00.000 | 3 | 1 | 1 | 0 | python,cocoa,macos,pyobjc | 2,176,187 | 8 | false | 0 | 0 | DO NOT ATTEMPT to avoid learning objective-C if you're going to write apps for the Mac. The purpose of PyObjC and the other language bindings is to let you re-use existing libraries in your apps, not to let you avoid learning the native tools. | 3 | 13 | 0 | I know some Python and I'm really impressed by the language's ease of use. From what I've seen of Objective-C it looks a lot less pretty, but it seems to be the lingua franca for Mac OS X development (which means it has better documentation).
I'm thinking about starting Mac development - will using PyObjC+Python make ... | What are the downsides of using Python instead of Objective-C? | 0.07486 | 0 | 0 | 3,245 |
2,176,053 | 2010-02-01T10:44:00.000 | 0 | 0 | 1 | 0 | python | 2,176,058 | 5 | false | 0 | 0 | The currently executing interpreter is available in sys.executable. You can just pass that explicitly to subprocess.Popen as the first argument, or pass it as the 'executable' argument. | 1 | 1 | 0 | I have a python script, which is executing again 4-5 python scripts.
For performance reasons i want to use same interpreter for executing all the script.
How could I handle this issue? | Python: Execute multiple Scripts simultaneously from same Interpreter | 0 | 0 | 0 | 5,764 |
2,179,395 | 2010-02-01T19:19:00.000 | 2 | 0 | 1 | 0 | python,jython | 2,191,492 | 3 | false | 1 | 0 | I use Jython in testing and rapid-development.
From my point of view it is stable. | 2 | 5 | 0 | I am planning to use Jython with Django. I want to know how stable the Jython project is, how easy to use it is, and how large its developer community is. | Using Jython with Django? | 0.132549 | 0 | 0 | 462 |
2,179,395 | 2010-02-01T19:19:00.000 | 3 | 0 | 1 | 0 | python,jython | 2,181,008 | 3 | false | 1 | 0 | I have not used Django with Jython, so I can't speak to that specific issue, but I've used Jython for other things and I've found it quite stable of late, and just as easy as plain Python. I believe the "core committers" in Jython are substantially fewer than in C-Python (maybe 1/3 the number or less), if that's what ... | 2 | 5 | 0 | I am planning to use Jython with Django. I want to know how stable the Jython project is, how easy to use it is, and how large its developer community is. | Using Jython with Django? | 0.197375 | 0 | 0 | 462 |
2,180,156 | 2010-02-01T21:17:00.000 | 0 | 1 | 0 | 1 | python,solaris,getrusage | 2,193,909 | 2 | false | 0 | 0 | Well...you can pull it from the pmap application by calling pmap -x. But I was looking more for a way to access the info directly in /proc from my app. The only way to do it is to access the /proc/<pid>/xmap file. Unfortunately, the data is stored as an array of prxmap structs...so either a Python C-module is in order... | 1 | 1 | 0 | Calling resource.getrusage() from Python returns a 0 value for resident set size on Solaris and Linux systems. On Linux you can pull the RSS From /proc//status instead. Does anybody have a good way to pull RSS on Solaris, either similar or not to the Linux workaround? | How can I grap resident set size from Python on Solaris? | 0 | 0 | 0 | 479 |
2,180,299 | 2010-02-01T21:45:00.000 | 4 | 0 | 1 | 0 | python,random | 43,429,228 | 5 | false | 0 | 0 | From the code in Antimony's answers it is easy to see that random.random() never returns exactly 1.0 on platforms that have at least 53 bit mantissa for calculations involving constants not annotated with 'f' in C. That's the precision IEEE 754 prescribes and is standard today.
However, on platforms with lower precisio... | 1 | 19 | 0 | Does python's random.random() ever return 1.0 or does it only return up until 0.9999..? | Range of python's random.random() from the standard library | 0.158649 | 0 | 0 | 26,013 |
2,181,209 | 2010-02-02T00:54:00.000 | 0 | 0 | 1 | 0 | python,multiprocessing | 2,181,412 | 2 | false | 0 | 0 | Try importing the ctypes module and looking for pthread_schedparam() or SetThreadPriority() (Linux / Windows). | 1 | 13 | 0 | Does anyone know of an easy way to set the niceness value of a Process or Pool when it is created in multiprocessing? | Multiprocessing and niceness value | 0 | 0 | 0 | 2,306 |
2,182,512 | 2010-02-02T07:42:00.000 | 0 | 0 | 0 | 0 | python,django | 2,182,519 | 2 | false | 1 | 0 | Not as shown. Use the ifequal and with template tags instead. | 1 | 1 | 0 | All,
Can t we do the following in templates
{% if subject.id == selected_id %}
and also cannot we assign variable like {{selected="selected"}}
Thank........ | Django templates condition check | 0 | 0 | 0 | 3,034 |
2,183,786 | 2010-02-02T12:00:00.000 | 1 | 0 | 1 | 0 | python,regex,validation | 2,183,799 | 3 | false | 0 | 0 | int() and check for exceptions
float() - but what do you mean float?
int() and then check using if
using datetime formatting | 1 | 1 | 0 | I want to do the following with python:
Validate if a UTF8 string is an integer.
Validate if a UTF8 string is a float.
Validate if a UTF8 string is of length(1-255).
Validate if a UTF8 string is a valid date.
I'm totally new to python and I believe this should be done with regular expression, except maybe for the las... | python regular expression to validate types of strings | 0.066568 | 0 | 0 | 1,739 |
2,185,177 | 2010-02-02T15:27:00.000 | 2 | 1 | 0 | 0 | python,algorithm,genetic-algorithm,evolutionary-algorithm,traveling-salesman | 2,185,816 | 3 | false | 0 | 0 | If your problem is that peaks remain for over one thousand generations, then the problem might not be with the crossover and mutation operators. You might not be introducing or keeping enough variation to your population: I would examine the proportions of crossovers, of mutations, and of survivors from one generation... | 1 | 5 | 0 | I'm building a genetic algorithm to tackle the traveling salesman problem. Unfortunately, I hit peaks that can sustain for over a thousand generations before mutating out of them and getting better results. What crossover and mutation operators generally do well in this case? | Suggested GA operators for a TSP problem? | 0.132549 | 0 | 0 | 2,732 |
2,185,329 | 2010-02-02T15:45:00.000 | 0 | 0 | 0 | 1 | python,apache-flex,pylons,twisted | 2,258,476 | 1 | false | 1 | 0 | I'm working on webapp which has client-side UI coded in Flex 3 and backend is Pylons app. Our client communicates with backend using HTTP GET and POST requests, POST request bodies and all response bodies carry data in JSON format. Works well, just few gotchas:
Flex apps cannot do PUT and DELETE requests. We work arou... | 1 | 0 | 0 | Has anyone used Python/Pylons as the server backend for a Flex 3 application? Does anyone have any thoughts on how well this would work? I read Bruce Eckel's article about tying Flex 3 to Twisted, and I've done Twisted programming, but for just a web service I think Pylons is simpler to use.
Thanks in advance,
Doug | Pylons and Flex 3 | 0 | 0 | 0 | 251 |
2,187,115 | 2010-02-02T19:45:00.000 | 1 | 0 | 0 | 0 | python,ajax,mako,turbogears2 | 2,187,227 | 1 | true | 1 | 0 | jQuery, YUI, Prototype, Dojo, and MooTools all set the header X-Requested-With: XMLHttpRequest. You should be able to check for that header. | 1 | 0 | 0 | How do I go about checking if a request is an ajax request in a controller method in Turbogears? Further, is it possible to return a 'partial' much like in rails or symfony if the request is an ajax request. I know about the json decorator but I need a way to return a partial of a mako template (because I need to forma... | how to check if request is ajax in turbogears | 1.2 | 0 | 0 | 1,369 |
2,187,135 | 2010-02-02T19:49:00.000 | 1 | 0 | 1 | 0 | python,range,numbers,xrange | 2,187,235 | 9 | false | 0 | 0 | range(x) returns a list.Python lists cant contain that many elements. You should use xrange() to iterate through those digits if you need to do trillions of cycles.? | 2 | 12 | 0 | range() and xrange() work for 10-digit-numbers. But how about 13-digit-numbers? I didn't find anything in the forum. | range and xrange for 13-digit numbers in Python? | 0.022219 | 0 | 0 | 12,305 |
2,187,135 | 2010-02-02T19:49:00.000 | 0 | 0 | 1 | 0 | python,range,numbers,xrange | 2,187,340 | 9 | false | 0 | 0 | The difference between range() and xrange() is that the first returns the entire list, while the second returns a generator that generates each number as it is needed. The second one should work for any number, no matter how large.
In Python 3.0, xrange() has disappeared and range() behaves like xrange() did previously... | 2 | 12 | 0 | range() and xrange() work for 10-digit-numbers. But how about 13-digit-numbers? I didn't find anything in the forum. | range and xrange for 13-digit numbers in Python? | 0 | 0 | 0 | 12,305 |
2,187,561 | 2010-02-02T20:47:00.000 | 1 | 0 | 0 | 0 | python,django,django-templates | 2,187,606 | 2 | false | 1 | 0 | 0x94 is not part of î in UTF-8. The UTF-8 encoding for î is 0xc3 0xae. | 2 | 2 | 0 | I'm trying to send a django email with UTF-8 characters in the template, specifically:
S'il vous plaît
I get the error:
UnicodeDecodeError: 'utf8' codec can't decode byte 0x94 in position 147: unexpected code byte
When trying to encode the special "î" character (that is the character at that position.)
Here is my c... | How can I render a Django template that has UTF8 characters in it? | 0.099668 | 0 | 0 | 4,616 |
2,187,561 | 2010-02-02T20:47:00.000 | 6 | 0 | 0 | 0 | python,django,django-templates | 2,187,613 | 2 | true | 1 | 0 | The editor you're using has saved the file using Mac Roman encoding. Open the template, re-save it as UTF-8, and it should work fine. | 2 | 2 | 0 | I'm trying to send a django email with UTF-8 characters in the template, specifically:
S'il vous plaît
I get the error:
UnicodeDecodeError: 'utf8' codec can't decode byte 0x94 in position 147: unexpected code byte
When trying to encode the special "î" character (that is the character at that position.)
Here is my c... | How can I render a Django template that has UTF8 characters in it? | 1.2 | 0 | 0 | 4,616 |
2,187,583 | 2010-02-02T20:50:00.000 | 51 | 0 | 1 | 0 | python,namespaces | 2,187,636 | 3 | true | 0 | 0 | It has two purposes:
Anybody who reads the source will know what the exposed public API is. It doesn't prevent them from poking around in private declarations, but does provide a good warning not to.
When using from mod import *, only names listed in __all__ will be imported. This is not as important, in my opinion, b... | 1 | 27 | 0 | I've seen it a lot in python/Lib source code but I don't know what it is for.
I thought it was used to limit accessible members of of a module. So only the elements at __all__ will show up when dir(module).
I did a little example and saw it was not working as I expected.
So... What's the python __all__ module level var... | What's the python __all__ module level variable for? | 1.2 | 0 | 0 | 17,072 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.