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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,994,777 | 2011-11-03T12:22:00.000 | 0 | 1 | 1 | 0 | python,oop,first-class-functions | 8,043,889 | 4 | false | 0 | 0 | In Smalltalk you'd mostly be using blocks. You can also create classes and instances at runtime. | 2 | 0 | 0 | I have a program in python that includes a class that takes a function as an argument to the __init__ method. This function is stored as an attribute and used in various places within the class. The functions passed in can be quite varied, and passing in a key and then selecting from a set of predefined functions would... | What is the equivalent of passing functions as arguments using an object oriented approach | 0 | 0 | 0 | 163 |
7,994,777 | 2011-11-03T12:22:00.000 | 1 | 1 | 1 | 0 | python,oop,first-class-functions | 7,995,586 | 4 | true | 0 | 0 | I don't understand what you mean by "equivalent... using an object oriented approach". In Python, since functions are (as you say) first-class objects, how is it not "object-oriented" to pass functions as arguments?
a standard way to achieve this in a language where functions aren't first class objects?
Only to the e... | 2 | 0 | 0 | I have a program in python that includes a class that takes a function as an argument to the __init__ method. This function is stored as an attribute and used in various places within the class. The functions passed in can be quite varied, and passing in a key and then selecting from a set of predefined functions would... | What is the equivalent of passing functions as arguments using an object oriented approach | 1.2 | 0 | 0 | 163 |
7,995,202 | 2011-11-03T12:53:00.000 | 0 | 0 | 0 | 0 | android,python,sl4a | 7,995,273 | 4 | false | 1 | 1 | I think, what you want to do is make an independently apk file, that includes the python interpret and your script code.
I don't know if this can be done in Android. The only whay I know is running your script from Android Scripting Environment. | 2 | 4 | 0 | Can I port existing python scripts on android using SL4A or ASE ? What I specifically want to do is to create an android application with normal UI elements and run the python scripts from the application itself, get the output and display it. Is this possible ? | Android and Python | 0 | 0 | 0 | 1,064 |
7,995,202 | 2011-11-03T12:53:00.000 | 2 | 0 | 0 | 0 | android,python,sl4a | 7,995,341 | 4 | true | 1 | 1 | Personnaly I think that you ask implicitly for three points:
Compatibility Desktop/Mobile
The first is the compatibility between the python library on the phone and the python library in your computer. If you don't use third party library and be sure to include the extra python library provided by sl4a, you should gene... | 2 | 4 | 0 | Can I port existing python scripts on android using SL4A or ASE ? What I specifically want to do is to create an android application with normal UI elements and run the python scripts from the application itself, get the output and display it. Is this possible ? | Android and Python | 1.2 | 0 | 0 | 1,064 |
7,995,290 | 2011-11-03T13:00:00.000 | 1 | 0 | 0 | 0 | python,sockets,asynchronous,udp | 7,995,699 | 1 | true | 0 | 0 | Asynchronous sockets are more effective then synchronous. But if the game is lagging for 4+ clients, then your server/client system is badly written and it is not the matter of sockets imho. | 1 | 0 | 0 | So i been readying for a awhile now. And it seems like asynchronous socket handling would be a better approach to dealing with what I'm trying to do.
Right now I'm working on a gaming server. At the moment socket server will do ok with about 3 clients or so. Sending data at the same exact time.
But my problem is, af... | Is asynchronous socket handling the way i need to go? In Python | 1.2 | 0 | 1 | 198 |
8,000,162 | 2011-11-03T18:37:00.000 | 1 | 0 | 0 | 0 | python,calendar,billing | 8,001,091 | 3 | false | 0 | 0 | This problem is not as hard as you think. All you have to do is write a function that given a starting day (like 13 or 30) it returns two date objects which are the beginning and end of the current fiscal month. You have already sketched out all the details in your question. Best to include an optional todayis paramete... | 1 | 3 | 0 | I'm in calendar hell, and I'm hoping there exists a Python module out there that does what I want.
I'm making a Python web app that deals with subscriptions. It's conceptually similar to a cell phone plan: You start your subscription on a certain date (say 1.13.2011), and for every billing month you have a bunch of "se... | Looking for *existing* Python module for determining fiscal months | 0.066568 | 0 | 0 | 1,622 |
8,000,280 | 2011-11-03T18:47:00.000 | 2 | 1 | 0 | 0 | python,mercurial,hook,mercurial-hook | 8,000,347 | 2 | false | 0 | 0 | changegroup hook is called once per push. If you want to analyse each changeset, then you want incoming hook (there's no input hook AFAIK) — it'll be called for each changeset, with ID in HG_NODE environment variable. You can get the commit message with e.g. hg log -r $HG_NODE --template '{desc}' or via the API. | 1 | 2 | 0 | I would like to write a hook for Mercurial to do the following, an am struggling to get going.:
Run on central repo, and execute when changeset(s) are pushed (I think I should use the "input" or "changegroup" hook)
Search each commit message for a string with the format "issue:[0-9]*"
IF string found, call a webservic... | How to access commit message from Mercurial Input or Changeset hook | 0.197375 | 0 | 0 | 817 |
8,001,384 | 2011-11-03T20:24:00.000 | 3 | 1 | 0 | 1 | python,ruby,linux,vim,emacs | 8,001,512 | 5 | false | 1 | 0 | I am an Emacs guy (using vi only to edit configuration files under /etc). I think that with Emacs, you should start it at most daily (and it is very different with vim), and you should configure it in your .emacs file. For example, I compile using the F12 key, with (global-set-key [f12] 'recompile) in my .emacs. | 3 | 6 | 0 | I've been an Eclipse user for the last 3 years or more. I do Java EE (and Spring) development in it and so far I've done 90% of my tasks without having to touch the mouse. Typically my Eclipse setup is as follow:
Subclipse (or alternatively I use command line)
m2clipse (Maven Eclipse plugin)
Data Source Explorer (de... | How to become productive using Vim/Emacs | 0.119427 | 0 | 0 | 1,355 |
8,001,384 | 2011-11-03T20:24:00.000 | 5 | 1 | 0 | 1 | python,ruby,linux,vim,emacs | 8,001,471 | 5 | false | 1 | 0 | If you ask a question which involves "vim OR emacs" you will never get an useful answer. It's a religious question, which does not have a correct answer! That said, you should clearly use Vim! ;-)
But seriously: Vim is much more lightweight, so it might better suite the scenario you are describing. Vim can be scripted ... | 3 | 6 | 0 | I've been an Eclipse user for the last 3 years or more. I do Java EE (and Spring) development in it and so far I've done 90% of my tasks without having to touch the mouse. Typically my Eclipse setup is as follow:
Subclipse (or alternatively I use command line)
m2clipse (Maven Eclipse plugin)
Data Source Explorer (de... | How to become productive using Vim/Emacs | 0.197375 | 0 | 0 | 1,355 |
8,001,384 | 2011-11-03T20:24:00.000 | 1 | 1 | 0 | 1 | python,ruby,linux,vim,emacs | 8,001,983 | 5 | false | 1 | 0 | Either of those text editors will have a learning curve. That being said I have successfully used emacs to do the following tasks that are in line w/ what you've asked:
Write PL/SQL and execute it on an oracle DB all from the editor.
Write, Compile, Run java.
Edit pom files.
Keep a pretty good TODO list in org mode.... | 3 | 6 | 0 | I've been an Eclipse user for the last 3 years or more. I do Java EE (and Spring) development in it and so far I've done 90% of my tasks without having to touch the mouse. Typically my Eclipse setup is as follow:
Subclipse (or alternatively I use command line)
m2clipse (Maven Eclipse plugin)
Data Source Explorer (de... | How to become productive using Vim/Emacs | 0.039979 | 0 | 0 | 1,355 |
8,002,282 | 2011-11-03T21:43:00.000 | 2 | 0 | 0 | 1 | python,batch-file | 8,002,349 | 1 | false | 0 | 0 | Absolutely. If there's a space in the path, you need to put the whole path in double quotes. | 1 | 2 | 0 | I have this line in my bat file:
C:\Python26\python.exe C:\myPythonDirectory.py
But it fails giving the error: can't open file [Errno2] no such file or directory.
Could it be giving an error because there is a space in one of the folder names in my python directory? | Errors trying to run a python script from a batch file | 0.379949 | 0 | 0 | 579 |
8,002,569 | 2011-11-03T22:13:00.000 | 17 | 0 | 0 | 0 | python,numpy,hdf5,pytables | 8,002,777 | 1 | true | 0 | 0 | PyTables files are HDF5 files.
However, as I understand it, PyTables adds some extra metadata to the attributes of each entry in the HDF file.
If you're looking for a more "vanilla" hdf5 solution for python/numpy, have a look a h5py.
It's less database-like (i.e. less "table-like") than PyTables, and doesn't have as ma... | 1 | 14 | 1 | Is there a difference between HDF5 files and files created by PyTables?
PyTables has two functions .isHDFfile() and .isPyTablesFile() suggesting that there
is a difference between the two formats.
I've done some looking around on Google and have gathered that PyTables is built on top of HDF, but I wasn't able to find ... | Difference between HDF5 file and PyTables file | 1.2 | 0 | 0 | 2,253 |
8,005,948 | 2011-11-04T07:14:00.000 | 2 | 0 | 0 | 0 | python,django,django-forms | 8,006,177 | 3 | true | 1 | 0 | The more built-in forms, the less work for developers. You are free to implement them from 0 but it is always faster to use something that is already done and tested.
Anyway, you have something in the middle: inherit from built-in forms and customize them. | 1 | 2 | 0 | Are there any real reason to use builtin forms in django?
One of them as I understand is validation. Ok. And maybe some convinience (but not for me).
Anything else?
Is there any acceleration in site work with forms? | Django forms: reasons to use them? | 1.2 | 0 | 0 | 282 |
8,008,220 | 2011-11-04T10:59:00.000 | 0 | 0 | 0 | 0 | python,gtk,pygtk | 8,008,432 | 1 | false | 0 | 1 | It sounds incredibly unlikely that the dialog should somehow mess with event handler connections for unrelated widgets.
Make sure the dialog is not stuck in a nested main loop (the call you mention has run in its name, implying a call to gtk_main() is taking place to make the dialog modal). | 1 | 0 | 0 | I've got a pygtk app which uses gtk print_run_page_setup_dialog. For some reason, some widgets (siblings to button that invoked the dialog) are no more redrawn after closing this dialog. Forcibly calling queue_draw on them works fine.
I'd like to identify where are the events going, and reconnect them to proper locatio... | Redraw events lost? | 0 | 0 | 0 | 43 |
8,017,514 | 2011-11-05T01:28:00.000 | 2 | 1 | 0 | 0 | python,tdd | 8,017,802 | 4 | false | 0 | 0 | I use a piece of paper to create a test list (scratchpad to keep track of tests so that I don't miss out on them). I hope you're not writing all the failing tests at one go (because that can cause some amount of thrashing as new knowledge comes in with each Red-Green-Refactor cycle).
To mark a test as TO-DO or Not impl... | 3 | 2 | 0 | If you are in the middle of a TDD iteration, how do you know which tests fail because the existing code is genuinely incorrect and which fail because either the test itself or the features haven't been implemented yet? Please don't say, "you just don't care, because you have to fix both." I'm ready to move past that ... | TDD practice: Distinguishing between genuine failures and unimplemented features | 0.099668 | 0 | 0 | 1,102 |
8,017,514 | 2011-11-05T01:28:00.000 | 1 | 1 | 0 | 0 | python,tdd | 8,017,731 | 4 | false | 0 | 0 | Most projects would have a hierarchy (e.g. project->package->module->class) and if you can selectively run tests for any item on any of the levels or if your report covers these parts in detail you can see the statuses quite clearly. Most of the time, when an entire package or class fails, it's because it hasn't been i... | 3 | 2 | 0 | If you are in the middle of a TDD iteration, how do you know which tests fail because the existing code is genuinely incorrect and which fail because either the test itself or the features haven't been implemented yet? Please don't say, "you just don't care, because you have to fix both." I'm ready to move past that ... | TDD practice: Distinguishing between genuine failures and unimplemented features | 0.049958 | 0 | 0 | 1,102 |
8,017,514 | 2011-11-05T01:28:00.000 | 0 | 1 | 0 | 0 | python,tdd | 8,021,286 | 4 | false | 0 | 0 | I also now realize that the unittest.expectedFailure decorator accomplishes functionality congruent with my needs. I had always thought that this decorator was more for tests that require certain environmental conditions that might not exist in the production environment where the test is being run, but it actually ma... | 3 | 2 | 0 | If you are in the middle of a TDD iteration, how do you know which tests fail because the existing code is genuinely incorrect and which fail because either the test itself or the features haven't been implemented yet? Please don't say, "you just don't care, because you have to fix both." I'm ready to move past that ... | TDD practice: Distinguishing between genuine failures and unimplemented features | 0 | 0 | 0 | 1,102 |
8,019,172 | 2011-11-05T08:59:00.000 | 3 | 1 | 0 | 0 | java,c++,python,c,algorithm | 8,019,217 | 3 | false | 0 | 0 | In other words, you have an array X[1..n], and want to have all the subsets of it for which sum(subset) >= 1/2 * sum(X), right?
That probably means the whole set qualifies.
After that, you can drop any element k having X[k] < 1/2 * sum(X), and every such a coalition will be fine as an answer, too.
After that, you can ... | 2 | 1 | 1 | I am looking for an algorithm that is implemented in C, C++, Python or Java that calculates the set of winning coalitions for n agents where each agent has a different amount of votes. I would appreciate any hints. Thanks! | Coalition Search Algorithm | 0.197375 | 0 | 0 | 373 |
8,019,172 | 2011-11-05T08:59:00.000 | 0 | 1 | 0 | 0 | java,c++,python,c,algorithm | 8,019,235 | 3 | false | 0 | 0 | Arrange the number of votes for each of the agents into an array, and compute the partial sums from the right, so that you can find out SUM_i = k to n Votes[i] just by looking up the partial sum.
Then do a backtrack search over all possible subsets of {1, 2, ...n}. At any point in the backtrack you have accepted some s... | 2 | 1 | 1 | I am looking for an algorithm that is implemented in C, C++, Python or Java that calculates the set of winning coalitions for n agents where each agent has a different amount of votes. I would appreciate any hints. Thanks! | Coalition Search Algorithm | 0 | 0 | 0 | 373 |
8,020,673 | 2011-11-05T14:09:00.000 | 2 | 0 | 1 | 1 | python,windows,easy-install | 8,020,986 | 3 | false | 0 | 0 | easy_install is an executable program, not a Python script. Run it from the Windows command line, not from Python. | 1 | 4 | 0 | I use Windows 7 and Python IDLE.
I'm trying to use easy_install but gut this error:
Traceback (most recent call last): File "", line 1, in
easy_install NameError: name 'easy_install' is not defined
In included in my 'Path' the directory where it has been installed (C:\Python27\Scripts).
Any thoughts on wha... | Install error easy_install python | 0.132549 | 0 | 0 | 7,877 |
8,021,674 | 2011-11-05T16:50:00.000 | 3 | 0 | 0 | 1 | python,logging,web2py,nohup | 10,672,167 | 4 | true | 1 | 0 | Nothing to worry. Actually the python process along with nohup was logging the file in batch mode and i could see the output only after quite some time and not instantaneously. | 3 | 0 | 0 | I am running a python script of web2py and want to log its output. I am using following command
nohup python /var/www/web2py/web2py.py -S cloud -M -N -R applications/cloud/private/process.py >>/var/log/web2pyserver.log 2>&1 &
The process is running but it is not logging into the file. I have tried without nohup also bu... | nohup not logging in nohup.out | 1.2 | 0 | 0 | 1,610 |
8,021,674 | 2011-11-05T16:50:00.000 | 0 | 0 | 0 | 1 | python,logging,web2py,nohup | 12,594,155 | 4 | false | 1 | 0 | If you've got commas in your print statements there's a good chance it's due to buffering. You can put a sys command (forget which) in your code or when you run the nohup, just add the option -u and you'll disable std(in|out|err) buffering | 3 | 0 | 0 | I am running a python script of web2py and want to log its output. I am using following command
nohup python /var/www/web2py/web2py.py -S cloud -M -N -R applications/cloud/private/process.py >>/var/log/web2pyserver.log 2>&1 &
The process is running but it is not logging into the file. I have tried without nohup also bu... | nohup not logging in nohup.out | 0 | 0 | 0 | 1,610 |
8,021,674 | 2011-11-05T16:50:00.000 | 0 | 0 | 0 | 1 | python,logging,web2py,nohup | 8,022,039 | 4 | false | 1 | 0 | nohup will try to create the file in the local directory. Can you create a file in the folder you are running it from ? | 3 | 0 | 0 | I am running a python script of web2py and want to log its output. I am using following command
nohup python /var/www/web2py/web2py.py -S cloud -M -N -R applications/cloud/private/process.py >>/var/log/web2pyserver.log 2>&1 &
The process is running but it is not logging into the file. I have tried without nohup also bu... | nohup not logging in nohup.out | 0 | 0 | 0 | 1,610 |
8,022,035 | 2011-11-05T17:46:00.000 | 1 | 0 | 0 | 0 | python,qt,widget,pyside | 8,022,220 | 1 | false | 0 | 1 | I usually use QTextBrowser for a "logging" widget.
Just create a QTextBrowser widget in your main window (i.e. self.log_widget = QTextBrowser())
Add it to some layout to be visible and part of the window
Log messages to it with the append method (which accepts a string). (i.e. self.log_widget.append('Hello'))
QTextBr... | 1 | 1 | 0 | I am porting my console app to a QT gui. The app get data from a website and prints the rsult line by line in the console ( I use spyder). Each line are a few strings.
Now I want to add a gui to the app so others can use the app as well.
With QT designer I designed a nice gui. In a Main module I call the UI. Now I am ... | Print results in Qt widget iso console | 0.197375 | 0 | 0 | 970 |
8,022,495 | 2011-11-05T18:58:00.000 | 4 | 1 | 0 | 1 | python,logging,nginx,uwsgi | 8,022,616 | 2 | true | 0 | 0 | use logging.StreamHandler as logging handler | 2 | 8 | 0 | I have a server running nginx + UWSGI + python. UWSGI is running as a daemon with the flag set: --daemonize /var/log/uwsgi.log which logs all application errors.
I've noticed that on error if I use a python print statement it will write to the log but only on an error. The standard python logging library doesn't seem t... | How to write to log in python with nginx + uwsgi | 1.2 | 0 | 0 | 11,471 |
8,022,495 | 2011-11-05T18:58:00.000 | 5 | 1 | 0 | 1 | python,logging,nginx,uwsgi | 8,022,729 | 2 | false | 0 | 0 | uWSGI is a wsgi server, and as such passes a stream in the environ dict passed to the application callable it hosts, using the key wsgi.errors. If you are writing a bare wsgi app, then writing to that stream should do the job. If you are using a framework that abstracts the wsgi interface out (and by the sound of it,... | 2 | 8 | 0 | I have a server running nginx + UWSGI + python. UWSGI is running as a daemon with the flag set: --daemonize /var/log/uwsgi.log which logs all application errors.
I've noticed that on error if I use a python print statement it will write to the log but only on an error. The standard python logging library doesn't seem t... | How to write to log in python with nginx + uwsgi | 0.462117 | 0 | 0 | 11,471 |
8,022,530 | 2011-11-05T19:05:00.000 | -4 | 1 | 1 | 0 | python,regex,email-validation,email-address | 8,022,687 | 18 | false | 0 | 0 | The only really accurate way of distinguishing real, valid email addresses from invalid ones is to send mail to it. What counts as an email is surprisingly convoluted ("John Doe" <john.doe@example.com>" actually is a valid email address), and you most likely want the email address to actually send mail to it later. A... | 2 | 240 | 0 | Is there a good way to check a form input using regex to make sure it is a proper style email address? Been searching since last night and everybody that has answered peoples questions regarding this topic also seems to have problems with it if it is a subdomained email address. | How to check for valid email address? | -1 | 0 | 0 | 384,064 |
8,022,530 | 2011-11-05T19:05:00.000 | 0 | 1 | 1 | 0 | python,regex,email-validation,email-address | 54,658,606 | 18 | false | 0 | 0 | Use this filter mask on email input:
emailMask: /[\w.\-@'"!#$%&'*+/=?^_{|}~]/i` | 2 | 240 | 0 | Is there a good way to check a form input using regex to make sure it is a proper style email address? Been searching since last night and everybody that has answered peoples questions regarding this topic also seems to have problems with it if it is a subdomained email address. | How to check for valid email address? | 0 | 0 | 0 | 384,064 |
8,024,609 | 2011-11-06T01:24:00.000 | 3 | 0 | 0 | 1 | python,google-app-engine | 8,034,730 | 1 | true | 1 | 0 | This is a known bug in the Python 2.7 runtime - if the result of a datastore query is >1MB then you will get this response.
It will be fixed in 1.6.1. | 1 | 4 | 0 | I just migrated my GAE/python app from M/S to HRD and then activated the new python27 runtime.
Now most of my datastore queries are failing with this error:
ResponseTooLargeError: The response from API call datastore_v3.RunQuery() was too large.
The same code is still running on older GAE app (M/S and python25) with no... | Datastore 'Response too large error' since migrated to Python27 | 1.2 | 0 | 0 | 190 |
8,025,379 | 2011-11-06T05:19:00.000 | 0 | 0 | 0 | 0 | python,perl,forms,mechanize | 8,025,567 | 3 | false | 1 | 0 | Use a browser that understands javascript as per WWW::Mechnize::FAQ, a browser like WWW::Mechanize::Firefox or WWW::Scripter | 2 | 0 | 0 | it is a html including two forms. One of them is generated dynamic by js when the page is loaded
So, if I try to fetch them, only one form could be return, and the form generated dynamic not found.
the question is
how to fetch all forms even if they are generated by js. | mechanize could not retrieve all forms(including some generated by js) | 0 | 0 | 0 | 225 |
8,025,379 | 2011-11-06T05:19:00.000 | 1 | 0 | 0 | 0 | python,perl,forms,mechanize | 8,026,558 | 3 | false | 1 | 0 | Launch Firefox, use HTTP Live Headers to inspect what the javascript does, then imitate that using Mechanize / relevant HTTP requests. | 2 | 0 | 0 | it is a html including two forms. One of them is generated dynamic by js when the page is loaded
So, if I try to fetch them, only one form could be return, and the form generated dynamic not found.
the question is
how to fetch all forms even if they are generated by js. | mechanize could not retrieve all forms(including some generated by js) | 0.066568 | 0 | 0 | 225 |
8,025,677 | 2011-11-06T07:05:00.000 | 0 | 0 | 0 | 0 | android,python,sl4a | 8,026,521 | 3 | false | 1 | 0 | You need a file explorer (I used andexplorer) to transfer the files to sl4a's install dir (ideally in a subdirectory), and unzip them there. | 1 | 1 | 0 | How do I download zipped files containing python source code into the android SL4A ? I've tried going to the website and downloading it but the download always fails. Also can I install python-urwid in android? | Android SL4A query | 0 | 0 | 0 | 432 |
8,026,162 | 2011-11-06T09:28:00.000 | 0 | 0 | 0 | 0 | python,wsgi | 8,026,738 | 2 | false | 1 | 0 | If you are not going to use any frameworks or libraries, you just have to implement it manually: use some kind of storage for credentials, generate forms, check passwords preferrably using salted hashes, create and store session identifiers in cookies and so on.
But maybe if it's not intended to be a public application... | 1 | 0 | 0 | I try to make simple wsgi application without any frameworks, only standard library (wsgiref). And now I looking for simple way to make authentication in my application. How I can make it?
Thanks. | authentication on python for wsgi application | 0 | 0 | 0 | 320 |
8,028,001 | 2011-11-06T15:17:00.000 | 1 | 0 | 0 | 0 | python,linux,tkinter,diskspace,analyzer | 8,028,597 | 1 | true | 0 | 0 | "Better" is subjective. I will gladly offer my opinion that there is no toolkit better than Tkinter for this task. This task seemingly doesn't need much eye candy or the ability to print, which are Tkinter's weak points. Tkinter is easy to use, modern, stable, and very customizable. Plus, you probably already have it. ... | 1 | 0 | 0 | I'm creating a Disk Analyzer in Linux. I would like to know which Python toolkit will help me with the GUI. I'm currently trying Tkinter is there something better? | Python toolkit for disk analyzer | 1.2 | 0 | 0 | 192 |
8,028,708 | 2011-11-06T17:03:00.000 | 0 | 0 | 1 | 0 | python,dynamic | 8,029,645 | 7 | false | 0 | 0 | You can use a local dictionary and put all the dynamic bindings as items into the dictionary. Then knowing the name of such a "dynamic variable" you can use the name as the key to get its value. | 1 | 109 | 0 | How do you dynamically set local variable in Python (where the variable name is dynamic)? | Dynamically set local variable | 0 | 0 | 0 | 86,370 |
8,032,576 | 2011-11-07T03:57:00.000 | 1 | 0 | 0 | 0 | python,amazon-s3,amazon-web-services,boto,amazon-iam | 8,074,814 | 1 | true | 1 | 0 | Contacted the author of boto and learned of:
get_canonical_user_id() for the S3Connection class.
This will give you the canonical user ID for the credentials associated with the connection. The connection will have to have been used for some operation (e.g.: listing buckets).
Very awkward, but possible. | 1 | 2 | 0 | Does a canonical user id exist for a federated user created using STS? When using boto I need a canonical user id to grant permissions to a bucket.
Here's a quick tour through my code:
I've successfully created temporary credentials using boto's STS module (using a "master" account), and this gives me back:
federa... | Do AWS Canonical UserIDs exist for AWS Federated Users (temporary security credentials)? | 1.2 | 1 | 0 | 718 |
8,032,655 | 2011-11-07T04:14:00.000 | 2 | 0 | 0 | 0 | java,python,ruby-on-rails,ruby | 8,032,682 | 3 | false | 1 | 0 | My rule of thumb for personal (which I think this is) projects is to either use the language you're most familiar with OR the one you're most interested in learning. Java, python and ruby are all great languages and MVC frameworks such as RoR exist for all of them.
That being said if you're interested in trying C# (wh... | 1 | 0 | 0 | I'm building a Rails web app but I would like to start building a desktop version but I don't know what language or framework to use.
I've been thinking on developing it with Ruby too or Python or Java. I'm open to new languages as long as the framework is awesome and enjoyable to work with.
What LANGUAGE and FRAMEWOR... | What is an Object Oriented desktop application framework similar to Rails? | 0.132549 | 0 | 0 | 228 |
8,033,379 | 2011-11-07T06:30:00.000 | 0 | 0 | 1 | 0 | ironpython | 8,042,169 | 1 | false | 0 | 0 | If you use any standard Python modules, you have to either include them when compiling MyScript.dll with pyc.py or put them onto target machine somewhere your script can find them - the easiest to the same folder as MyScript.dll. | 1 | 0 | 0 | I would like to make my compiled IronPython script run on other machine. So, I made a zip file for the following list of DLLs. (My script also compiled with pyc.py for making exe type.)
IronPython.dll
IronPython.Modules.dll
Microsoft.Dynamic.dll
Microsoft.Scripting.dll
MyScript.dll
MyScript.exe
Then, I moved it to othe... | How about runtime environment needed for compiled IronPython script? | 0 | 0 | 0 | 183 |
8,034,767 | 2011-11-07T09:37:00.000 | 0 | 1 | 0 | 0 | python,mechanize | 8,035,293 | 2 | false | 1 | 0 | The server blocks your activity with such response.
Is it your site? If not, follow the rules:
Obey robots.txt file
Put a delay between request, even if robots.txt doesn't require it.
Provide some contact information (e-mail or page URL) in the User-Agent header.
Otherwise be ready site owner blocking you based on Us... | 1 | 3 | 0 | I am trying out Mechanize to make some routine simpler. I have managed to bypass that error by using br.set_handle_robots(False). There are talks about how ethical it's to use it. What I wonder about is where this error is generated, on my side, or on server side? I mean does Mechanize throw the exception when it sees ... | On what side is 'HTTP Error 403: request disallowed by robots.txt' generated? | 0 | 0 | 0 | 997 |
8,035,412 | 2011-11-07T10:50:00.000 | 1 | 1 | 0 | 0 | python,macos,python-3.x | 8,035,989 | 2 | false | 0 | 0 | Install the packages with the binary from your version of python.
So for example if your version is in /usr/local/bin then installing would be either:
/usr/local/bin/python setup.py ...
/usr/local/bin/easy_install ...
/usr/local/bin/pip install ... | 1 | 1 | 0 | I've used easy_install to get one or two modules, then I used pip to install the Twitter module.
However the newer version of Python I downloaded can't see these modules, only the built in OSX version can.
Also, I am now unable to download NLTK which I need for some examples I'm working through on a really good book ca... | Install Python modules on new Python version | 0.099668 | 0 | 0 | 840 |
8,037,783 | 2011-11-07T14:26:00.000 | 23 | 0 | 0 | 1 | java,python,google-app-engine,go | 8,038,951 | 5 | false | 1 | 0 | The cost of instances is only part of the cost of your app. I only use the Java runtime right now, so I don't know how much more or less efficient things would be with Python or Go, but I don't imagine it will be orders of magnitude different. I do know that instances are not the only cost you need to consider. Depe... | 4 | 53 | 0 | Will google Go use less resources than Python and Java on Appengine? Are the instance startup times for go faster than Java's and Python's startup times?
Is the go program uploaded as binaries or source code and if it is uploaded as source code is it then compiled once or at each instance startup?
In other words: Will... | Resource usage of google Go vs Python and Java on Appengine | 1 | 0 | 0 | 12,094 |
8,037,783 | 2011-11-07T14:26:00.000 | 17 | 0 | 0 | 1 | java,python,google-app-engine,go | 10,370,469 | 5 | false | 1 | 0 | The question is mostly irrelevant.
The minimum memory footprint for a Go app is less than a Python app which is less than a Java app. They all cost the same per-instance, so unless your application performs better with extra heap space, this issue is irrelevant.
Go startup time is less than Python startup time which i... | 4 | 53 | 0 | Will google Go use less resources than Python and Java on Appengine? Are the instance startup times for go faster than Java's and Python's startup times?
Is the go program uploaded as binaries or source code and if it is uploaded as source code is it then compiled once or at each instance startup?
In other words: Will... | Resource usage of google Go vs Python and Java on Appengine | 1 | 0 | 0 | 12,094 |
8,037,783 | 2011-11-07T14:26:00.000 | 47 | 0 | 0 | 1 | java,python,google-app-engine,go | 10,283,180 | 5 | false | 1 | 0 | Will google Go use less resources than Python and Java on Appengine?
Are the instance startup times for go faster than Java's and Python's
startup times?
Yes, Go instances have a lower memory than Python and Java (< 10 MB).
Yes, Go instances start faster than Java and Python equivalent because the runtime only nee... | 4 | 53 | 0 | Will google Go use less resources than Python and Java on Appengine? Are the instance startup times for go faster than Java's and Python's startup times?
Is the go program uploaded as binaries or source code and if it is uploaded as source code is it then compiled once or at each instance startup?
In other words: Will... | Resource usage of google Go vs Python and Java on Appengine | 1 | 0 | 0 | 12,094 |
8,037,783 | 2011-11-07T14:26:00.000 | 0 | 0 | 0 | 1 | java,python,google-app-engine,go | 8,044,755 | 5 | false | 1 | 0 | I haven't used Go, but I would strongly suspect it would load and execute instances much faster, and use less memory purely because it is compiled. Anecdotally from the group, I believe that Python is more responsive than Java, at least in instance startup time.
Instance load/startup times are important because when y... | 4 | 53 | 0 | Will google Go use less resources than Python and Java on Appengine? Are the instance startup times for go faster than Java's and Python's startup times?
Is the go program uploaded as binaries or source code and if it is uploaded as source code is it then compiled once or at each instance startup?
In other words: Will... | Resource usage of google Go vs Python and Java on Appengine | 0 | 0 | 0 | 12,094 |
8,039,374 | 2011-11-07T16:24:00.000 | 1 | 0 | 0 | 0 | python,google-app-engine,web-applications,authentication,credentials | 8,060,118 | 2 | true | 1 | 0 | Are you using the built in authentication, or trying to roll your own? If the former, you can't access a user's credentials - just get the information you need from the User object. If the latter, you can handle the credentials any way you wish - you're rolling your own, and App Engine has no magic way to detect that w... | 2 | 2 | 0 | What is an accepted way to get authentication credentials (login and password) when using webapp?
I'm pretty sure that they get submitted and/or interpreted differently than the rest of the information coming through the request and I'm afraid I can't remember where exactly I'm supposed to get them from.
FYI: The reque... | Getting login credentials when using webapp | 1.2 | 0 | 1 | 198 |
8,039,374 | 2011-11-07T16:24:00.000 | 2 | 0 | 0 | 0 | python,google-app-engine,web-applications,authentication,credentials | 8,039,432 | 2 | false | 1 | 0 | If you've got HTTPS enabled, sending them along with the request (usually a POST) is acceptable, and the "standard" method of logging in.
If you want to get clever, you could hash the password using SHA1 on the client end so that even an sslstrip won't reveal the password in plaintext (though it won't prevent replay at... | 2 | 2 | 0 | What is an accepted way to get authentication credentials (login and password) when using webapp?
I'm pretty sure that they get submitted and/or interpreted differently than the rest of the information coming through the request and I'm afraid I can't remember where exactly I'm supposed to get them from.
FYI: The reque... | Getting login credentials when using webapp | 0.197375 | 0 | 1 | 198 |
8,039,566 | 2011-11-07T16:37:00.000 | 2 | 0 | 0 | 0 | python,redis | 8,039,797 | 1 | true | 0 | 0 | My initial thought would be to store the data elsewhere, like relational database, or possibly using a zset.
If you had continuous data (meaning it was consistently set at N interval time periods), then you could store the hash key as the member and the date (as a int timestamp) as the value. Then you could do a zrank... | 1 | 1 | 0 | I store several properties of objects in hashsets. Among other things, something like "creation date". There are several hashsets in the db.
So, my question is, how can I find all objects older than a week for example? Can you suggest an algorithm what faster than O(n) (naive implementation)?
Thanks,
Oles | Redis: find all objects older than | 1.2 | 1 | 0 | 462 |
8,041,501 | 2011-11-07T19:30:00.000 | 0 | 0 | 0 | 0 | python,scripting | 8,077,102 | 5 | false | 1 | 0 | Plain CGI is a good starting point to learn about server side scripting, but it is an outdated technology and gets difficult to maintain after certain level of complexity. I would think it is no longer used in industrial-grade web server anymore. Plus you have to setup a web server and then install some module to inter... | 1 | 0 | 0 | I am wondering how to go about implementing a web application with Python.
For example, the html pages would link to python code that would give it increased functionality and allow it to write to a database.
Kind of like how Reddit does it. | How to develop a simple web application with server-side Python | 0 | 0 | 0 | 7,276 |
8,041,852 | 2011-11-07T19:59:00.000 | 0 | 1 | 0 | 0 | python,parsing,email | 8,041,910 | 2 | true | 0 | 0 | The email module doesn't give me a way to extract the content. if I make a message object, the object doesn't have a field for the content of the body.
Of course it does. Have a look at the Python documentation and examples. In particular, look at the walk and payload methods. | 1 | 2 | 0 | I have some mails in txt format, that have been forwarded multiple times.
I want to extract the content/the main body of the mail. This should be at the last position in the hierarchy..right? (Someone point this out if I'm wrong).
The email module doesn't give me a way to extract the content. if I make a message obje... | Forwarded Email parsing in Python/Any other language? | 1.2 | 0 | 0 | 1,419 |
8,045,576 | 2011-11-08T03:24:00.000 | 4 | 0 | 0 | 0 | python,optimization,scipy | 15,979,342 | 2 | false | 0 | 0 | The scipy.optimize.minimize methods has a parameter called "jac". If set to True, minimize will expect the callable f(x) to both return the function value and it's derivatives. | 1 | 3 | 1 | I have a fairly complex function f(x) that I want to optimize and I am using the fmin_bfgs function from the scipy.optimize module from Scipy. It forces me to give the function to minimize and the function of the gradient f'(x) separately, which is a pity because some of the computations for the gradient can be done w... | How to force the functions of the optimize module of scipy to take a function and its gradient simultaneously | 0.379949 | 0 | 0 | 557 |
8,045,630 | 2011-11-08T03:32:00.000 | 3 | 1 | 0 | 0 | php,python,ruby,web-applications | 8,045,724 | 5 | false | 1 | 0 | I'd say given your requirement
Just relatively small amounts of dynamic content among otherwise HTML pages.
then, PHP is going to be hard to beat for getting going quickly and a minimum of learning overhead. It avoids all the CGI issues that you would otherwise have to deal with, and is in fact its own templating lan... | 1 | 12 | 0 | I first learned web programming with php a while back. It has some features that I find very helpful, but the overall language is not something I enjoy, just as a matter of personal preference. I am wondering what alternatives I could use to provide similar functionality using a different underlying programming languag... | Alternatives to php for in-line web programming? | 0.119427 | 0 | 0 | 7,993 |
8,045,991 | 2011-11-08T04:32:00.000 | 4 | 0 | 1 | 0 | python,eclipse,pydev | 8,046,295 | 2 | false | 0 | 0 | You may check File Associations option.
In Eclipse it can be found in Window -> Preferences, General -> Editors -> File Associations.
*.py files should have Python Editor by default. | 2 | 8 | 0 | Sometimes when I open a python file (.py extension) in the PyDev Package Explorer, that file is opened as a plain text file - without syntax highlighting, breakpoint setting and all the other great PyDev features. I cannot see any differences to other files in the same folder. When I create another .py file (this time ... | Sometimes PyDev doesn't recognise .py files as python source files | 0.379949 | 0 | 0 | 4,313 |
8,045,991 | 2011-11-08T04:32:00.000 | 9 | 0 | 1 | 0 | python,eclipse,pydev | 8,049,228 | 2 | true | 0 | 0 | If this happens (and the association for file marks "Python editor" as the default in the preferences), you can right-click the file and do "open with > other" and choose "Python editor" from the list.
That setting should be persisted for that file later on (what could've happened is that you opened the file as text a... | 2 | 8 | 0 | Sometimes when I open a python file (.py extension) in the PyDev Package Explorer, that file is opened as a plain text file - without syntax highlighting, breakpoint setting and all the other great PyDev features. I cannot see any differences to other files in the same folder. When I create another .py file (this time ... | Sometimes PyDev doesn't recognise .py files as python source files | 1.2 | 0 | 0 | 4,313 |
8,047,092 | 2011-11-08T07:17:00.000 | 8 | 0 | 0 | 0 | python,html,django | 8,047,122 | 4 | false | 1 | 0 | Django templates has {# ... #} as comments. NOTE: These comments are not multi-line. | 1 | 4 | 0 | I'm curious, i have the following code {% code_goes_here %}, how do I comment it out in the html file? | Is there a way to comment out python code in a django html file? | 1 | 0 | 0 | 3,772 |
8,048,047 | 2011-11-08T09:05:00.000 | 0 | 0 | 1 | 0 | python,memory,padding,bitstring | 8,048,417 | 1 | true | 0 | 0 | If you're referring to padding the bitstrings to an integral number of bytes, then you could store the concatenation of all the initial bitstrings in a single bitstring, and keep a dictionary whose values are tuples of the form (bit position, length).
Problem is, if I did the math right, then the length of this larger ... | 1 | 2 | 0 | I have a dict from some hash key to a bitstring. The bitstring can be variable length, but are generally < 160 bits and usually <80. I have about 80M key value pairs.
How can I store this data structure in as little memory as possible? I don't want to pad the bitstrings, or I will lose quite a bit of space (no pun inte... | Can I store a dict with bitstring values in memory without padding? | 1.2 | 0 | 0 | 181 |
8,048,702 | 2011-11-08T10:03:00.000 | 2 | 1 | 1 | 0 | python,save,python-idle | 8,058,543 | 2 | false | 0 | 0 | Unfortunately, IDLE doesn't and can't add the .py extension automatically; you will just have to get into the habit of adding it yourself, or use another IDE like Eclipse or Komodo that will do it for you. | 1 | 2 | 0 | In Python IDE, while we save the script, it will prompt the save Dialog. If we specify the filename as "Test". Then file will be saved without extension as "Test" and not "Test.py".
Is it possible to save the script with .py extension automatically (as Test.py)? | Save Python scripts with .py extension automatically | 0.197375 | 0 | 0 | 3,171 |
8,048,742 | 2011-11-08T10:06:00.000 | 0 | 0 | 0 | 0 | python,mysql,linux,indexing | 9,198,763 | 2 | false | 0 | 0 | There are a lot of tweaks that can be done to improve the performance of MySQL. Given your workload, you would probably benefit a lot from mysql 5.5 and higher, which improved performance on multiprocessor machines. Is the machine in question hitting VM? if it is paging out, then the performance of mysql will be horrib... | 1 | 1 | 0 | I am running several thousand python processes on multiple servers which go off, lookup a website, do some analysis and then write the results to a central MySQL database.
It all works fine for about 8 hours and then my scripts start to wait for a MySQL connection.
On checking top it's clear that the MySQL daemon is ov... | Python processes and MySQL | 0 | 1 | 0 | 197 |
8,051,087 | 2011-11-08T13:25:00.000 | 2 | 1 | 0 | 0 | php,python,ruby,scalability | 8,051,192 | 3 | false | 1 | 0 | PHP can do it well. Python also can do it using web frameworks like Django or turbogears.
That being said, language is not an issue as long as it has web capabilities which your post seems to dictate | 3 | 4 | 0 | I plan to build a photo-sharing site like Flickr/Picasa for photographers, with features most suited for them. As you know, if that venture proves successful, many GB to TB of data transfers take place every day.
This question is not just about scalability of my application as it grows, but also performance. I would li... | Language best for a Photo-sharing site: PHP, Python, Ruby or something else? | 0.132549 | 0 | 0 | 1,102 |
8,051,087 | 2011-11-08T13:25:00.000 | 0 | 1 | 0 | 0 | php,python,ruby,scalability | 8,052,193 | 3 | false | 1 | 0 | I've done Web applications in PHP, ColdFusion, Java, and Ruby, with various frameworks. I find Rails to be the most powerful Web framework I've ever used. Nothing can really equal it, because the power comes from the Ruby language, and no other language (except maybe Smalltalk) can really equal that. That said, as long... | 3 | 4 | 0 | I plan to build a photo-sharing site like Flickr/Picasa for photographers, with features most suited for them. As you know, if that venture proves successful, many GB to TB of data transfers take place every day.
This question is not just about scalability of my application as it grows, but also performance. I would li... | Language best for a Photo-sharing site: PHP, Python, Ruby or something else? | 0 | 0 | 0 | 1,102 |
8,051,087 | 2011-11-08T13:25:00.000 | 7 | 1 | 0 | 0 | php,python,ruby,scalability | 8,051,120 | 3 | true | 1 | 0 | Any. The language doesn't matter. Ruby-fanatics (especially the RubyOnRails sort) will try and tell you that their language will do everything in only 10 lines and it'll make you dinner and pick the kids up from school. Others will tell you that their language is the most secure, fastest, quickest to develop in, etc. I... | 3 | 4 | 0 | I plan to build a photo-sharing site like Flickr/Picasa for photographers, with features most suited for them. As you know, if that venture proves successful, many GB to TB of data transfers take place every day.
This question is not just about scalability of my application as it grows, but also performance. I would li... | Language best for a Photo-sharing site: PHP, Python, Ruby or something else? | 1.2 | 0 | 0 | 1,102 |
8,051,614 | 2011-11-08T14:03:00.000 | 3 | 0 | 0 | 0 | python,orm,mongodb | 8,051,721 | 3 | false | 0 | 0 | Interesting question. Although NoSQL databases do not have a mechanism to identify relationships, it does not mean that there are no logical relationships between the data that you are storing. Most of the time, you are handling & enforcing those relationships in code manually if you're using a NoSQL database.
Hence, I... | 3 | 8 | 0 | sorry, but does this make sense? the ORM means: Object Relational Mapper, and here, there is Relational, and NoSql is not RDBMS! so why the use of an ORM in a NoSql solution? because i see updates of ORMs for Python! | why the use of an ORM with NoSql (like MongoDB) | 0.197375 | 1 | 0 | 4,264 |
8,051,614 | 2011-11-08T14:03:00.000 | 2 | 0 | 0 | 0 | python,orm,mongodb | 8,051,652 | 3 | false | 0 | 0 | ORM is an abstraction layer. Switching to a different engine is much easier when the queries are abstracted away, and hidden behind a common interface (it doesn't always work that well in practice, but it's still easier than without). | 3 | 8 | 0 | sorry, but does this make sense? the ORM means: Object Relational Mapper, and here, there is Relational, and NoSql is not RDBMS! so why the use of an ORM in a NoSql solution? because i see updates of ORMs for Python! | why the use of an ORM with NoSql (like MongoDB) | 0.132549 | 1 | 0 | 4,264 |
8,051,614 | 2011-11-08T14:03:00.000 | 13 | 0 | 0 | 0 | python,orm,mongodb | 8,051,825 | 3 | true | 0 | 0 | Firstly, they are not ORM (since they don't have any relations among them), they are ODM (Object Document Mapper)
Main usage of these ODM frameworks here same as the some common feature of ORM, thus
providing the abstraction over your data model. you can have your data modelled in your application irrespective of the... | 3 | 8 | 0 | sorry, but does this make sense? the ORM means: Object Relational Mapper, and here, there is Relational, and NoSql is not RDBMS! so why the use of an ORM in a NoSql solution? because i see updates of ORMs for Python! | why the use of an ORM with NoSql (like MongoDB) | 1.2 | 1 | 0 | 4,264 |
8,051,630 | 2011-11-08T14:05:00.000 | 3 | 0 | 1 | 0 | python | 8,051,888 | 4 | true | 0 | 0 | I think your only choices are:
Have every update mark a "dirty flag" when it alters a value from its starting state.
Doing a whole structure analysis (like the pickle/md5 combination you suggested).
Just run a fixed number of iterations known to reach a steady state (possibly running too many times but not having the ... | 2 | 4 | 0 | I have a more-or-less complex data structure (list of dictionaries of sets) on which I perform a bunch of operations in a loop until the data structure reaches a steady-state, ie. doesn't change anymore. The number of iterations it takes to perform the calculation varies wildly depending on the input.
I'd like to know ... | Loop until steady-state of a complex data structure in Python | 1.2 | 0 | 0 | 635 |
8,051,630 | 2011-11-08T14:05:00.000 | 2 | 0 | 1 | 0 | python | 8,051,736 | 4 | false | 0 | 0 | Checking for equality to me doesn't seem the right way to go. Provided that you have full control over the operations you perform, I would introduce a "modified" flag (boolean variable) that is set to false at the beginning of each iteration. Whenever one of your operation modifies (part of) your data structure, it is ... | 2 | 4 | 0 | I have a more-or-less complex data structure (list of dictionaries of sets) on which I perform a bunch of operations in a loop until the data structure reaches a steady-state, ie. doesn't change anymore. The number of iterations it takes to perform the calculation varies wildly depending on the input.
I'd like to know ... | Loop until steady-state of a complex data structure in Python | 0.099668 | 0 | 0 | 635 |
8,052,582 | 2011-11-08T15:10:00.000 | 0 | 0 | 0 | 0 | python,numpy,scipy,vectorization | 8,052,660 | 2 | false | 0 | 0 | You can try to improve python loops by doing good "practices" (like avoiding dots).
Maybe you can code you function in C (into a "numpy library") and call it from python. | 1 | 5 | 1 | I am looking for a function to calculate exponential moving sum in numpy or scipy. I want to avoid using python loops because they are really slow.
to be specific, I have two series A[] and T[]. T[i] is the timestamp of value A[i]. I define a half-decay period tau. For a given time t, the exponential moving sum is the... | exponential moving sum in numpy / scipy? | 0 | 0 | 0 | 2,259 |
8,053,295 | 2011-11-08T15:58:00.000 | -1 | 0 | 0 | 0 | python,urllib2 | 8,053,358 | 2 | false | 1 | 0 | It doesnt sound like fun to me, but every javascript function is a is also an object, so you can just read the function rather than call it and perhaps the URL is in it. Otherwise, that function may call another which you would then have to recurse into... Again, doesnt sound like fun, but might be doable. | 1 | 3 | 0 | I parse a website with python. They use a lot of redirects and they do them by calling javascript functions.
So when I just use urllib to parse the site, it doesn't help me, because I can't find the destination url in the returned html code.
Is there a way to access the DOM and call the correct javascript function from... | Getting the final destination of a javascript redirect on a website | -0.099668 | 0 | 1 | 5,021 |
8,054,953 | 2011-11-08T17:57:00.000 | 6 | 0 | 0 | 0 | emacs,ipython | 64,160,062 | 3 | false | 0 | 0 | C-c M-o runs the command comint-clear-buffer (found in
inferior-python-mode-map), which is an interactive compiled Lisp
function.
It is bound to C-c M-o.
(comint-clear-buffer)
Clear the comint buffer. | 1 | 7 | 0 | I am running and interactive ipython shell in an emacs buffer using ipython.el. I wonder if there is a way to clear the screen? Since it is not running on a terminal, the import os; os.system('CLS') trick will not work. Thanks. | how to clear ipython buffer in emacs? | 1 | 0 | 0 | 2,167 |
8,059,845 | 2011-11-09T03:00:00.000 | -2 | 0 | 0 | 0 | python,user-interface | 8,059,885 | 2 | false | 0 | 1 | Hmm, that looks very much like they are using Adobe AIR or maybe Flash. | 1 | 0 | 0 | So I've been tinkering with a few different GUI's but I haven't been able to even find a point to begin researching this question:
How do I make a GUI like Steam (Digital distribution app) has? More specifically, I'm interested in how they manage to make their SHIFT+TAB menu pop up in-game, without disrupting/pausing/e... | Programming a GUI Like Steam? | -0.197375 | 0 | 0 | 1,878 |
8,066,075 | 2011-11-09T13:58:00.000 | 1 | 0 | 0 | 1 | wxpython | 8,066,742 | 1 | true | 0 | 0 | It sounds like you're trying to open a file with a file dialog. wxPython wraps the native widgets where ever possible, so I'm guessing it's behaving the same way that the normal file dialog does. Try opening the file with a different program that loads that dialog and it'll probably behave the same way. On Windows when... | 1 | 0 | 0 | I'm working on a program for which I need to be able to open a zip file containing an itlp (iTunes LP) and then do stuff to it. I'm using wxFileDialog in wxPython for this purpose using the appropriate wildcard to only show zip files.
The problem is that because itlp's are folders not files they are still shown in t... | How do I stop wxFileDialog running on OSX from treating .itlp packages as files? | 1.2 | 0 | 0 | 106 |
8,066,221 | 2011-11-09T14:08:00.000 | 0 | 0 | 1 | 1 | python,macos | 20,572,635 | 4 | false | 0 | 0 | Open Activity monitor, go to the Processes tab, and highlight python.exe and quit it by clicking Quit. | 3 | 17 | 0 | I wrote a python script but accidentally put an infinite while loop in my script.
How do I kill the process? I've tried ctrl+c but with no success.
Are there any other option to try?
I'm on Mac Os X 10.7.2 with python 2.7 | Kill a python process | 0 | 0 | 0 | 59,787 |
8,066,221 | 2011-11-09T14:08:00.000 | 25 | 0 | 1 | 1 | python,macos | 8,066,307 | 4 | true | 0 | 0 | ps a to get the PID of your process. kill -9 <pid> to send it the unblockable SIGKILL signal.
Note that I only have a Linux box in front of me to test, so the OS X commands may be slightly different. | 3 | 17 | 0 | I wrote a python script but accidentally put an infinite while loop in my script.
How do I kill the process? I've tried ctrl+c but with no success.
Are there any other option to try?
I'm on Mac Os X 10.7.2 with python 2.7 | Kill a python process | 1.2 | 0 | 0 | 59,787 |
8,066,221 | 2011-11-09T14:08:00.000 | 29 | 0 | 1 | 1 | python,macos | 8,066,240 | 4 | false | 0 | 0 | Try Ctrl+\ to send a SIGQUIT. | 3 | 17 | 0 | I wrote a python script but accidentally put an infinite while loop in my script.
How do I kill the process? I've tried ctrl+c but with no success.
Are there any other option to try?
I'm on Mac Os X 10.7.2 with python 2.7 | Kill a python process | 1 | 0 | 0 | 59,787 |
8,067,171 | 2011-11-09T15:21:00.000 | 18 | 1 | 0 | 0 | python,c,ctypes,overhead | 8,069,179 | 2 | true | 0 | 1 | I've compared the performance of a C extension vs. a ctypes wrapper. In my particular test, the difference was about 250x. There were multiple calls into the C library so the ctypes wrapper was also executing Python code. The running time for the C library was very short which made the extra overhead for Python code ev... | 2 | 25 | 0 | I have a few functions written in C for a game project. These functions get called quite a lot (about 2000-4000 times per second). The functions are written in C for raw speed.
Now, the easiest way for me to include these functions into Python is to use ctypes. The alternative is to write a C extension to Python around... | ctypes vs C extension | 1.2 | 0 | 0 | 7,501 |
8,067,171 | 2011-11-09T15:21:00.000 | 9 | 1 | 0 | 0 | python,c,ctypes,overhead | 8,067,399 | 2 | false | 0 | 1 | The directly C coded interface has the potential to be much much faster. The bottleneck is the interface from Python to C and marshalling arguments and results may for example involve copying strings or converting Python lists to/from C arrays. If you have a loop that makes several hundred of these calls and some of th... | 2 | 25 | 0 | I have a few functions written in C for a game project. These functions get called quite a lot (about 2000-4000 times per second). The functions are written in C for raw speed.
Now, the easiest way for me to include these functions into Python is to use ctypes. The alternative is to write a C extension to Python around... | ctypes vs C extension | 1 | 0 | 0 | 7,501 |
8,067,673 | 2011-11-09T15:54:00.000 | 0 | 0 | 1 | 0 | python,eclipse | 8,251,020 | 2 | false | 0 | 0 | You could do this by setting up each main.py + data directory as its own Eclipse project, each with a custom run/debug configuration. You do have extra projects, but they don't require any ongoing maintenance.
After the initial setup, you continue work on the real python project and debugging any given data directory ... | 2 | 5 | 0 | I have a python project developed in eclipse. Independantly there are various data directories in various locations and it is desirable to operate on each with a different main.py that imports the python project. If I store a main.py with my data, how can I open it in eclipse and run the debugger?
I can run ipython in... | Opening various main.py files in Eclipse without creating a new project | 0 | 0 | 0 | 490 |
8,067,673 | 2011-11-09T15:54:00.000 | 0 | 0 | 1 | 0 | python,eclipse | 8,315,981 | 2 | false | 0 | 0 | If you're truly loath to make new projects, you could bring the main.py files into the project and store the location of the associated data directory inside each of them. Each main begins by changing to the data directory, and then runs as usual. In eclipse you set up multiple run configurations, one for each main.p... | 2 | 5 | 0 | I have a python project developed in eclipse. Independantly there are various data directories in various locations and it is desirable to operate on each with a different main.py that imports the python project. If I store a main.py with my data, how can I open it in eclipse and run the debugger?
I can run ipython in... | Opening various main.py files in Eclipse without creating a new project | 0 | 0 | 0 | 490 |
8,068,251 | 2011-11-09T16:36:00.000 | 5 | 0 | 1 | 0 | python,list-comprehension | 8,068,298 | 3 | false | 0 | 0 | There is no performance hit (even if there were, I would not worry about it; if performance were so important, you've got the wrong language). Some frown upon list comprehensions because they're a bit too terse for some, that's a matter of personal preference. Generally, I find simple list comprehensions to be much mor... | 1 | 12 | 0 | Many developers I have met suggest it's best practice to go with simple loops and if conditions instead of one line list comprehension statements.
I have always found them very powerful as I can fit a lot of code in a single line and it saves a lot of variables from being created. Why is it still considered a bad pract... | Why is python list comprehension sometimes frowned upon? | 0.321513 | 0 | 0 | 4,418 |
8,068,422 | 2011-11-09T16:47:00.000 | 1 | 0 | 0 | 0 | python,amazon-s3,amazon-web-services,boto | 8,068,778 | 1 | true | 0 | 0 | Right now, extra headers have to be specified on each request. The various methods of the bucket and key class all take an optional headers parameter and the contents of that dict gets merged into the request headers.
Being able to specify extra headers at the bucket level and then have those merged into all requests ... | 1 | 2 | 0 | Is it possible to set default headers for boto requests? Basically I want to include a couple of headers in every API call I make to S3. | Add "default" headers to all boto requests? | 1.2 | 0 | 1 | 348 |
8,069,029 | 2011-11-09T17:30:00.000 | 1 | 0 | 1 | 0 | python,windows,django,virtualenv | 8,069,779 | 3 | false | 1 | 0 | Virtualenv modifies the PATH to include a Python with the correct setup. It's a completely separate program from the system Python.
The PATH is used to look up programs by name: the first program of a given name that's in the PATH gets executed.
When you “run a file”, Windows uses the extension of the file to look up a... | 1 | 2 | 0 | I have virtualenv installed on windows.
In cmd, i run python and look at sys.path and see the virtualenv path included.
but when i run manage.py (for django), I don't see the virtualenv path,
so virtualenv is not working with django server.
Why? | on Windows, virtualenv is not being used with i run a python program | 0.066568 | 0 | 0 | 576 |
8,069,649 | 2011-11-09T18:21:00.000 | 0 | 0 | 0 | 1 | php,python,google-app-engine,cakephp | 8,070,747 | 5 | false | 1 | 0 | You can not run PHP on GAE. If you run PHP somewhere, it is a bad architecture to go over the internet for your data. It will be slooooow and a nightmare to develop in.
You should store your data where you run your php, unless you must have a distributed, globally scaling architecture, which afaiu not the case. | 1 | 0 | 0 | I'm thinking in create a webapplication with cakephp but consuming python's appengine webservice. But, to install cakephp etc, I need to configure the database. Appengine uses another kind of datastorage, with is different from mysql, etc.
I was thinking in store the data in appengine, and using the python webservices,... | Connect appengine with cakephp | 0 | 1 | 0 | 378 |
8,072,461 | 2011-11-09T22:10:00.000 | 0 | 0 | 0 | 1 | python,compilation,debian | 8,072,665 | 3 | false | 0 | 0 | Why do you think you need to compile it? Debian, like most other Linux distributions, comes with Python installed as standard, as many of the system tools depend on it. A Python script will just run. | 1 | 1 | 0 | I'm having a hard time finding a conclusive answer for how to compile a Python 2.7 .py file into a executable program for Debian. Most tutorials say "we assume you've already written the manifest, etc.", but I cannot find how to do those first steps.
So, I need a step-by-step. How do I take JUST a .py file (using Pytho... | How to compile .py into an executable for Debian | 0 | 0 | 0 | 2,610 |
8,073,753 | 2011-11-10T00:50:00.000 | 0 | 0 | 0 | 0 | python,proxy,smartcard,pkcs#11 | 8,079,122 | 1 | false | 0 | 0 | If Twisted has a proxy, then you can use it with M2Crypto+engine_pkcs11. I had the code, I can see if it is still existing somewhere. | 1 | 1 | 0 | Does anyone know of a web proxy written in Python that will support SSL connections and will also support PKCS#11 tokens? I am in need of a proxy that will send SSL web requests using a PKCS#11 smartcard.
I have been looking for projects that are using something like Twisted but have not seen any. | Python Web Proxy that Supports PKCS#11 | 0 | 0 | 1 | 459 |
8,073,882 | 2011-11-10T01:12:00.000 | 1 | 1 | 1 | 0 | python,lisp,cons | 8,073,914 | 6 | false | 0 | 0 | No. cons is an implementation detail of Lisp-like languages; it doesn't exist in any meaningful sense in Python. | 1 | 8 | 0 | Is there an equivalent of cons in Python? (any version above 2.5)
If so, is it built in? Or do I need easy_install do get a module? | LISP cons in python | 0.033321 | 0 | 0 | 8,394 |
8,074,227 | 2011-11-10T02:12:00.000 | 3 | 1 | 0 | 0 | python,security,smtp,credentials | 8,074,236 | 1 | true | 0 | 0 | They will only be encrypted if you use SMTP with TLS or SSL. | 1 | 1 | 0 | When I send credentials using the login method of the python SMTP library, do they go off the wire encrypted or as plaintext? | sending an email using python SMTP library credentials security | 1.2 | 0 | 1 | 232 |
8,074,595 | 2011-11-10T03:16:00.000 | 1 | 0 | 0 | 1 | python,video | 8,074,644 | 3 | false | 0 | 0 | I know of no mechanism to perform screen recording in Python. However, you may be able to use Python to control one of the many existing screen recording programs:
recorditnow
recordmydesktop
byzanz
istanbul
vnc2swf
pyvnc2swf | 1 | 5 | 0 | Is there a library for making a screen recorder application in python? i think it would be fun to make somthing like that. but a library that will work on linux im using ubuntu
Thanks ! | Screen recorder in python | 0.066568 | 0 | 0 | 14,740 |
8,075,052 | 2011-11-10T04:37:00.000 | 1 | 0 | 1 | 0 | python,django,timezone,python-datetime | 8,099,104 | 5 | true | 1 | 0 | The problem with relying on the client to self-report their time zone is that there is always a chance (how big of a chance is debateable) that what you will really get is a UTC offset. If you get a UTC offset, your logic will work fine most of the time, but in reality will only apply to the exact timestamps produced ... | 2 | 1 | 0 | I'm currently storing all times in UTC, to make things easier for when I start bringing multiple sites and servers online.
The problem comes in when translating date and datetime objects into strings in my templates and when accepting user input. 6:00PM UTC doesn't mean a whole lot to someone who is in PST. Likewise,... | Time zones and Localisation | 1.2 | 0 | 0 | 1,526 |
8,075,052 | 2011-11-10T04:37:00.000 | 0 | 0 | 1 | 0 | python,django,timezone,python-datetime | 8,075,182 | 5 | false | 1 | 0 | I wouldn't do ip geolocation. It can be very inaccurate, especially free services. Just ask the user for zip code or state, and store it in cookie. | 2 | 1 | 0 | I'm currently storing all times in UTC, to make things easier for when I start bringing multiple sites and servers online.
The problem comes in when translating date and datetime objects into strings in my templates and when accepting user input. 6:00PM UTC doesn't mean a whole lot to someone who is in PST. Likewise,... | Time zones and Localisation | 0 | 0 | 0 | 1,526 |
8,075,297 | 2011-11-10T05:17:00.000 | 12 | 0 | 0 | 0 | python,webdriver,selenium-webdriver | 18,481,265 | 3 | false | 0 | 0 | You can use browser.maximize_window() for that | 1 | 2 | 0 | I wanted to know how to maximize a browser window using the Python bindings for Selenium 2-WebDriver. | How to maximize a browser window using the Python bindings for Selenium 2-WebDriver? | 1 | 0 | 1 | 9,312 |
8,077,270 | 2011-11-10T09:19:00.000 | 0 | 0 | 1 | 0 | python,string,text | 8,712,704 | 4 | false | 0 | 0 | Are those phrases the same? Like is it the same word you want to remove? Then maybe you can remove it using the 'in' keyword. checking each line using a while loop and removing all instances of the word from that line. Need more information on the problem though. | 1 | 4 | 0 | I was wondering - is there someway I can remove large number (100s of thousands) of text phrases in one pass from a big (18 GB) text file? | How can I remove large number of phrases in one pass from a large text file? | 0 | 0 | 0 | 216 |
8,077,703 | 2011-11-10T09:57:00.000 | 1 | 0 | 0 | 0 | python,macos,pyqt,osx-leopard,qtwebkit | 8,760,805 | 1 | false | 0 | 1 | I was able to fix the problem by upgrading to MacOSX Lion, but if that is not an option I would just ensure that PyQt4 is not using qt4.8, which is where this issue was introduced. If I remember correctly, everything works well with qt4.7.4 | 1 | 1 | 0 | I've been requested to create an application with a webview in it.
I've tried to import QtWebKit module but I have this error:
Traceback (most recent call last): File "", line 1, in
ImportError:
dlopen(/Library/Python/2.6/site-packages/PyQt4/QtWebKit.so, 2): Symbol
not found: _kCFWebServicesProviderDefaultDis... | PyQt4 ImportError for QtWebKit on Mac OS Leopard | 0.197375 | 0 | 0 | 503 |
8,077,886 | 2011-11-10T10:12:00.000 | 1 | 1 | 0 | 0 | python,css,frameworks | 8,082,137 | 4 | false | 1 | 0 | I feel your pain. As a developer coming from the desktop world and doing some web development, I'm used to setting up the appearance of my application at the same time I select and arrange my user interface widgets.
You will just have to accept that browser based software does not work that way. You must separately l... | 2 | 0 | 0 | I hope this isn't knocked for being too general, but... I recently had occasion to learn web2py for a final year university project. In this subject teams of four had 8 weeks to design a web app. Ultimately i found that web2py was quite versatile, with it being very easy to get a site up and running fast, a lot of opti... | Web Frameworks with site style inbuilt | 0.049958 | 0 | 0 | 249 |
8,077,886 | 2011-11-10T10:12:00.000 | 1 | 1 | 0 | 0 | python,css,frameworks | 8,085,839 | 4 | false | 1 | 0 | So far what I've seen about Yii Framework (PHP) is that it can generate an initial nice Styled Web Application backbone, ready for you to work in it adding your functionality, DBs, User roles, etc. and of course all the freedom to define your own Look and Feel by defining HTML views, CSS, JS, etc.
I'm about to start le... | 2 | 0 | 0 | I hope this isn't knocked for being too general, but... I recently had occasion to learn web2py for a final year university project. In this subject teams of four had 8 weeks to design a web app. Ultimately i found that web2py was quite versatile, with it being very easy to get a site up and running fast, a lot of opti... | Web Frameworks with site style inbuilt | 0.049958 | 0 | 0 | 249 |
8,078,073 | 2011-11-10T10:27:00.000 | 0 | 1 | 0 | 0 | python,eclipse,autocomplete,pydev,arcgis | 8,596,504 | 1 | false | 0 | 0 | There isn't a similar folder for ArcGIS 9.3. ESRI did a major refactor of the Python API when going from 9.3 to 10 and there are many differences, of which this is one. I found Eclipse very useful for geocoding but I don't recall autocomplete working with ArcGIS 9.3, but I do recall there was an ESRI folder you neede... | 1 | 1 | 0 | I have ArcGIS 9.3, Eclipse Indigo with PyDev plugin installed. I am unable to configure PyDev so the autocompletion of arcgis functions will work.
I have added python interpreter and path to arcgis bin folder. I am able to run script, import of arcgiscripting works but autocompletion shows only functions that i already... | ArcGIS Eclipse PyDev - code autocomplete not working | 0 | 0 | 0 | 620 |
8,078,967 | 2011-11-10T11:43:00.000 | 2 | 0 | 1 | 1 | python,cygwin | 8,082,314 | 2 | false | 0 | 0 | No, Windows python has no suport for Cygwin paths, but Cygwin does have its own Python. If you can't add that to the existing Cygwin install, you might want to consider doing a user-specific Cygwin install into a directory that you're allowed to write to.
There is a way to obtain limited Cygwin path support for Windows... | 1 | 3 | 0 | I have access to a machine with a minimal cygwin installation, and the Windows version of python. I need to run some python scripts there, however python requires Windows paths. I can use cygpath -w, on the arguments that I provide, however further unix/cygwin paths are included in numerous other scripts which are subs... | Cygwin paths for Windows python | 0.197375 | 0 | 0 | 3,843 |
8,080,885 | 2011-11-10T14:04:00.000 | 1 | 1 | 0 | 0 | python,aix,import | 8,165,999 | 1 | true | 0 | 0 | I worked it around by extracting md5.so from hashlib.a. fortunately dynamic library was in the archive. | 1 | 1 | 0 | I am trying to set up python environment on AIX 6.1 TL7, python-2.7.1-1.aix6.1.ppc.rpm installation was successful, however when I try to use BaseHttpServer I am getting following error:
ImportError: No module named _md5
Please advise
Thank You,
m. | aix 6.1: python: ImportError: No module named _md5 | 1.2 | 0 | 0 | 1,049 |
8,082,243 | 2011-11-10T15:48:00.000 | 0 | 0 | 1 | 0 | python | 8,082,297 | 3 | false | 0 | 0 | Python documentation extensively refers to dictionaries and lists as containing 'items' | 2 | 1 | 0 | Let's take a random container in Python (list, dict...), do you say a container has items or do you refer to it as members? Documentation seems to suggest that only sets have members. | item or member, is there a rule how to refer to a container's contents? | 0 | 0 | 0 | 76 |
8,082,243 | 2011-11-10T15:48:00.000 | 2 | 0 | 1 | 0 | python | 8,082,280 | 3 | false | 0 | 0 | "Items" in Python usually are the things that can be retrieved or modified using the __getitem__() and __setitem__() functions, so lists and dictionaries have items. Sets in contrast don't implement __getitem__() and __setitem__(), so the documentation uses one of the usual terms to refer to the members of a set ("ele... | 2 | 1 | 0 | Let's take a random container in Python (list, dict...), do you say a container has items or do you refer to it as members? Documentation seems to suggest that only sets have members. | item or member, is there a rule how to refer to a container's contents? | 0.132549 | 0 | 0 | 76 |
8,083,263 | 2011-11-10T16:54:00.000 | 0 | 0 | 0 | 0 | python,image-processing,opencv,image-stitching | 11,141,963 | 1 | true | 0 | 0 | If this is a small fun project that you are trying to do, you can compare image histograms or use SIFT/SURF. I don't think there is implementation of SIFT, SURF in Python API. If you can find compatible equivalent, you can do it.
Comparing images are very much dependent on the data-set that you have. Some techniques wo... | 1 | 2 | 1 | I am trying to use OpenCV and Python to stitch together several hundred puzzle piece images into one large, complete image. All of the images are digitized and are in a PNG format. The pieces were originally from a scan and extracted into individual pieces, so they have transparent backgrounds and are each a single p... | Using OpenCV and Python to stitch puzzle images together | 1.2 | 0 | 0 | 1,769 |
8,084,260 | 2011-11-10T18:12:00.000 | 3 | 0 | 1 | 0 | python | 42,292,061 | 10 | false | 0 | 0 | you can also try this
print ''.join(file('example.txt')) | 1 | 98 | 0 | I've searched and I can only find questions about the other way around: writing stdin to a file.
Is there a quick and easy way to dump the contents of a file to stdout? | How to print a file to stdout? | 0.059928 | 0 | 0 | 129,873 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.