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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1,640,112 | 2009-10-28T21:06:00.000 | 3 | 0 | 1 | 0 | python,multithreading,queue | 1,641,189 | 3 | true | 0 | 0 | With Queue, you're guaranteed to be threadsafe in any implementation and version of Python. Relying on this or that method of some other object being "atomic" (in a given implementation and version) typically leaves you at the mercy of this "atomicity" not being a strong guarantee (just an implementation artifact for t... | 3 | 3 | 0 | I have a simple thread that grabs bytes from a Bluetooth RFCOMM (serial-port-like) socket and dumps them into a Queue.Queue (FIFO), which seems like the typical method to exchange data between threads. Works fine.
Is this overkill though? Could I just use a bytearray then have my reader thread .append(somebyte) and t... | Is a Python Queue needed for simple byte stream between threads? | 1.2 | 0 | 0 | 2,431 |
1,640,112 | 2009-10-28T21:06:00.000 | 0 | 0 | 1 | 0 | python,multithreading,queue | 1,640,262 | 3 | false | 0 | 0 | Yes, pop() is atomic, but I'd stick with Queue if performance is not super important. | 3 | 3 | 0 | I have a simple thread that grabs bytes from a Bluetooth RFCOMM (serial-port-like) socket and dumps them into a Queue.Queue (FIFO), which seems like the typical method to exchange data between threads. Works fine.
Is this overkill though? Could I just use a bytearray then have my reader thread .append(somebyte) and t... | Is a Python Queue needed for simple byte stream between threads? | 0 | 0 | 0 | 2,431 |
1,640,806 | 2009-10-28T23:30:00.000 | 11 | 1 | 0 | 0 | java,python,android | 1,641,125 | 3 | true | 1 | 0 | Java is "more native" on the Android platform; Python is coming after and striving to get parity but not quite there yet AFAIK. Roughly the reverse situation wrt App Engine, where Python's been around for a year longer than Java and so is still more mature and complete (even though Java's catching up).
So, in any situ... | 2 | 10 | 0 | Is there any reason to favor Python or Java over the other for developing on Android phones, other than the usual Python v. Java issues? | Android: Java v. Python | 1.2 | 0 | 0 | 4,643 |
1,640,806 | 2009-10-28T23:30:00.000 | 2 | 1 | 0 | 0 | java,python,android | 1,641,263 | 3 | false | 1 | 0 | On the mobile platform performance and memory usage are much more critical than desktop or server. The JVM that runs on Android is highly optimized for the mobile platform. Based on the links I have seen about Python on Android none of them seem to have an optimized VM for mobile platform. | 2 | 10 | 0 | Is there any reason to favor Python or Java over the other for developing on Android phones, other than the usual Python v. Java issues? | Android: Java v. Python | 0.132549 | 0 | 0 | 4,643 |
1,641,418 | 2009-10-29T03:11:00.000 | 11 | 0 | 1 | 1 | python | 1,641,426 | 2 | true | 0 | 0 | Find your site-packages directory and create a new file called myproj.pth
Inside that file, put each directory you want to add, one per line like so:
/home/myuser/svn-repos/myproject
/home/myuser/svn-repos/SomeOtherProject
Python loads *.pth every time it runs, and imports all paths in each of those files.
In Ubuntu... | 2 | 4 | 0 | I know there are multiple solutions online, but some are for windows, some are environmental variable, etc..
What is the best way? | How to permanently append a path to Python for Linux? | 1.2 | 0 | 0 | 1,063 |
1,641,418 | 2009-10-29T03:11:00.000 | 1 | 0 | 1 | 1 | python | 1,641,468 | 2 | false | 0 | 0 | I personally just define PYTHONPATH in ~/.bashrc, as for what's the "best" approach? I think that's hard to answer (or rather, there's no correct answer). It depends. | 2 | 4 | 0 | I know there are multiple solutions online, but some are for windows, some are environmental variable, etc..
What is the best way? | How to permanently append a path to Python for Linux? | 0.099668 | 0 | 0 | 1,063 |
1,643,362 | 2009-10-29T12:26:00.000 | 1 | 1 | 0 | 1 | python | 1,643,387 | 4 | false | 0 | 0 | Raise exeption and handle it in main or use sys.exit | 1 | 1 | 0 | I am looking for a simple Python webserver that is easy to kill from within code. Right now, I'm playing with Bottle, but I can't find any way at all to kill it in code. If you know how to kill Bottle (in code, no Ctrl+C) that would be super, but I'll take anything that's Python, simple, and killable. | Killing Python webservers | 0.049958 | 0 | 0 | 410 |
1,644,619 | 2009-10-29T15:39:00.000 | 8 | 0 | 1 | 0 | c++,python,interpreter,bytecode,cpython | 1,644,643 | 3 | false | 0 | 0 | CPython is both the bytecode compiler, and interpreter (virtual machine).
It automatically detects if no existing pre-compiler file (.pyc) exists, compiles the code, and saves it out. | 3 | 10 | 0 | I don't really get the concept of "bytecode interpreter" in the context of CPython. Can someone shed some light over the whole picture?
Does it mean that CPython will compile and execute pyc file (bytecode file?). Then what compile py file to pyc file? And how is Jython different from CPython (except they are implement... | CPython is bytecode interpreter? | 1 | 0 | 0 | 2,894 |
1,644,619 | 2009-10-29T15:39:00.000 | 14 | 0 | 1 | 0 | c++,python,interpreter,bytecode,cpython | 6,830,193 | 3 | false | 0 | 0 | First: The fact that CPython is a bytecode interpreter should not matter to you as a user of python. Go ahead and write code, and don't worry about how it's turned into action.
So, to answer your question and satisfy your curiosity, here is what happens: CPython reads python source code, and compiles it into python byt... | 3 | 10 | 0 | I don't really get the concept of "bytecode interpreter" in the context of CPython. Can someone shed some light over the whole picture?
Does it mean that CPython will compile and execute pyc file (bytecode file?). Then what compile py file to pyc file? And how is Jython different from CPython (except they are implement... | CPython is bytecode interpreter? | 1 | 0 | 0 | 2,894 |
1,644,619 | 2009-10-29T15:39:00.000 | 15 | 0 | 1 | 0 | c++,python,interpreter,bytecode,cpython | 1,644,742 | 3 | true | 0 | 0 | CPython is the implementation of Python in C. It's the first implementation, and still the main one that people mean when they talk about Python. It compiles .py files to .pyc files. .pyc files contain bytecodes. The CPython implementation also interprets those bytecodes.
CPython is not written in C++, it is C.
The... | 3 | 10 | 0 | I don't really get the concept of "bytecode interpreter" in the context of CPython. Can someone shed some light over the whole picture?
Does it mean that CPython will compile and execute pyc file (bytecode file?). Then what compile py file to pyc file? And how is Jython different from CPython (except they are implement... | CPython is bytecode interpreter? | 1.2 | 0 | 0 | 2,894 |
1,644,994 | 2009-10-29T16:36:00.000 | 0 | 0 | 0 | 0 | python,xml | 1,652,871 | 4 | false | 1 | 0 | You could use BeautifulStoneSoup (XML part of BeautifulSoup).
www.crummy.com/software/BeautifulSoup
It's not ideal, but it would circumvent the problem if you cannot fix the file's output...
It's basically a previously implemented version of what Denis said.
You can just join whatever you need into the soup and it will... | 2 | 5 | 0 | I have a file, which change it content in a short time. But I'd like to read it before it is ready. The problem is, that it is an xml-file (log). So when you read it, it could be, that not all tags are closed.
I would like to know if there is a possibility to close all opened tags correctly, that there are no problems ... | Close all opened xml tags | 0 | 0 | 1 | 1,809 |
1,644,994 | 2009-10-29T16:36:00.000 | 0 | 0 | 0 | 0 | python,xml | 1,645,047 | 4 | false | 1 | 0 | You can use any SAX parser by feeding data available so far to it. Use SAX handler that just reconstructs source XML, keep the stack of tags opened and close them in reverse order at the end. | 2 | 5 | 0 | I have a file, which change it content in a short time. But I'd like to read it before it is ready. The problem is, that it is an xml-file (log). So when you read it, it could be, that not all tags are closed.
I would like to know if there is a possibility to close all opened tags correctly, that there are no problems ... | Close all opened xml tags | 0 | 0 | 1 | 1,809 |
1,645,269 | 2009-10-29T17:19:00.000 | 13 | 0 | 0 | 0 | python,django,django-models,concurrency | 4,679,345 | 3 | false | 1 | 0 | I don't think that 'keeping a version number or timestamp' works.
When self.version == self.read_current_version() is True, there is still a chance that the version number got modified by other sessions just before you call super().save(). | 1 | 23 | 0 | How do I handle concurrency in a Django model? I don't want the changes to the record being overwritten by another user who reads the same record. | Concurrency control in Django model | 1 | 0 | 0 | 16,575 |
1,645,310 | 2009-10-29T17:26:00.000 | 2 | 0 | 0 | 0 | python,database,django,fixtures | 1,645,519 | 2 | true | 1 | 0 | As far as I know, the fixtures (in initial_data file) are automatically loaded after manage.py syndcb and not after reset. So, if you do a manage.py reset yourapp it should not load the fixtures. Hmm? | 1 | 1 | 0 | Is there an easy way to reset a django database (i.e. drop all data/tables, create new tables and create indexes) without loading fixture data afterwords? What I want to have is just an empty database because all data is loaded from another source (a kind of a post-processed backup).
I know that this could be achieved... | Django db reset without loading fixtures | 1.2 | 1 | 0 | 1,667 |
1,645,550 | 2009-10-29T18:07:00.000 | 3 | 0 | 1 | 0 | c#,.net,python,clr | 1,645,603 | 2 | false | 0 | 0 | This is supported at the CLR level. The argument variable at slot 0 represents the "this" pointer. C# essentially generates calls to this as ldarg.0 | 1 | 2 | 0 | When you have an object instance in C#, you can use the this keyword inside the instance scope. How does the compiler handles it? Is there any assistance for this at runtime?
I am mainly wondering how C# does it vs in python you have to provide self for every function manually. | How this keyword is provided for object instances in C#? | 0.291313 | 0 | 0 | 334 |
1,646,017 | 2009-10-29T19:29:00.000 | 1 | 1 | 1 | 0 | python,apache,mod-python | 1,646,473 | 1 | true | 0 | 0 | The version of Python used is set when mod_python is compiled. If you need to use a version other than the default, you'll need to recompile it, or you may be able to find a different package from the repository. | 1 | 1 | 0 | I have mod_python installed on a debian box with python 2.4 and 2.6 installed. I want mod_python to use 2.6 but it is finding 2.4. How can set it to use the other version. | Setting mod_python's interperter | 1.2 | 0 | 0 | 145 |
1,646,293 | 2009-10-29T20:21:00.000 | 4 | 0 | 1 | 1 | python,aix,ncurses,curses | 1,646,337 | 3 | true | 0 | 0 | I'd compile it from source myself and tell them where to download it from in the instructions | 1 | 6 | 0 | I need to make some Python applications for a work project. The target platform is AIX 5.3.
My question is: What version of Python should I be using?
My requirements are:
The Python version must be easy to install on the target machines. Others will do that according to instructions that I write, so no compiling from ... | Python on AIX: What are my options? | 1.2 | 0 | 0 | 13,755 |
1,647,568 | 2009-10-30T01:35:00.000 | 2 | 1 | 1 | 0 | python,google-app-engine,cryptography,rsa,pkcs#12 | 1,648,617 | 3 | true | 0 | 0 | If you can handle some ASN.1 generation, you can relatively easily convert a PKCS#8-file into a PKCS#12-file. A PKCS#12-file is basically a wrapper around a PKCS#8 and a certificate, so to make a PKCS#12-file, you just have to add some additional data around your PKCS#8-file and your certificate.
Usually a PKCS#12-file... | 1 | 2 | 0 | I'm using Python (under Google App Engine), and I have some RSA private keys that I need to export in PKCS#12 format. Is there anything out there that will assist me with this? I'm using PyCrypto/KeyCzar, and I've figured out how to import/export RSA keys in PKCS8 format, but I really need it in PKCS12.
Can anybody poi... | How to encode an RSA key using PKCS12 in Python? | 1.2 | 0 | 0 | 2,305 |
1,647,974 | 2009-10-30T04:10:00.000 | 2 | 0 | 0 | 1 | python,django,logging | 1,648,183 | 1 | true | 1 | 0 | RotatingFileHandler is not designed to work in multiprocess system. Each process you have notice that file is too large and starts new log, so you get up to 5 new logs. It's not as easy to implement it properly: you have to obtain interprocess lock before creating new file and inform each process to reopen it. You'd be... | 1 | 1 | 0 | I use logging settings as below in the settings.py file:
logging.basicConfig(level=LOG_LEVEL, format=LOG_FORMAT);
handler = logging.handlers.RotatingFileHandler( LOG_FILE_PATH, 'a', LOG_FILE_SIZE,LOG_FILE_NUM );
formatter = logging.Formatter ( LOG_FORMAT );
handler.setFormatter(formatter);
logging.getLogger().addHandl... | mod_python django logging problem | 1.2 | 0 | 0 | 556 |
1,649,401 | 2009-10-30T12:03:00.000 | 4 | 0 | 0 | 0 | python,httplib | 1,649,579 | 1 | true | 0 | 0 | HTTPResponse.getheaders() returns a list of combined headers (actually my calling dict.items()). The only place where incoming headers are stored untouched is HTTPResponse.msg.headers. | 1 | 4 | 0 | I'm trying to write simple proxy server for some purpose. In it I use httplib to access remote web-server. But there's one problem: web server returns TWO Set-Cookie headers in one response, and httplib mangles them together in httplib.HTTPResponse.getheaders(), effectively joining cookies with comma [which is strange,... | How to handle multiple Set-Cookie header in HTTP response | 1.2 | 0 | 1 | 2,867 |
1,649,412 | 2009-10-30T12:04:00.000 | 1 | 0 | 0 | 1 | python,compilation,aix,ncurses | 9,372,135 | 3 | false | 0 | 0 | This is so old problem(2009 ??)..but I meet the same problem today!!
For other AIX users like me...I will leave my case
OK..first, Check your environmental variable OBJECT_MODE.
In my case, OBJECT_MODE was 64, but the archive file libcurses.a contains
only 32bit object files!!
After changing the environmental variable... | 2 | 0 | 0 | I'm trying to build Python 2.6.4 on AIX 5.3. I'm running configure like this:
./configure --prefix=/home/chenf/python --disable-ipv6 --disable-shared --with-libs='/usr/lib/libncurses.a' --without-threads --disable-threads --with-ncurses=/utv/sad/ncurses/lib/libncurses.a
I seem to be having linking problems with ncurs... | Problem compiling Python 2.6.4 on AIX 5.3 | 0.066568 | 0 | 0 | 2,579 |
1,649,412 | 2009-10-30T12:04:00.000 | 0 | 0 | 0 | 1 | python,compilation,aix,ncurses | 1,661,609 | 3 | false | 0 | 0 | Thanks to Jed Smith's suggestions, I've managed to get this to work. This is what I did accomplish this:
Step one: First, I edited "Makefile.pre.in". I replaced the line "CC= @CC@" with "CC= gcc". As far as I can tell, this forced the compilation to use gcc instead of whatever other unnamable hideousness AIX tried... | 2 | 0 | 0 | I'm trying to build Python 2.6.4 on AIX 5.3. I'm running configure like this:
./configure --prefix=/home/chenf/python --disable-ipv6 --disable-shared --with-libs='/usr/lib/libncurses.a' --without-threads --disable-threads --with-ncurses=/utv/sad/ncurses/lib/libncurses.a
I seem to be having linking problems with ncurs... | Problem compiling Python 2.6.4 on AIX 5.3 | 0 | 0 | 0 | 2,579 |
1,650,856 | 2009-10-30T16:21:00.000 | 1 | 0 | 0 | 0 | python,ms-access | 1,652,783 | 6 | false | 0 | 0 | Is your script executing a single INSERT statement per row of data? If so, pre-processing the data into a text file of many rows that could then be inserted with a single INSERT statement might improve the efficiency and cut down on the accumulating temporary crud that's causing it to bloat.
You might also make sure t... | 4 | 1 | 0 | I have a database which I regularly need to import large amounts of data into via some python scripts. Compacted, the data for a single months imports takes about 280mb, but during the import file size swells to over a gb.
Given the 2gb size limit on mdb files, this is a bit of a concern. Apart from breaking the insert... | MS-Access Database getting very large during inserts | 0.033321 | 1 | 0 | 3,989 |
1,650,856 | 2009-10-30T16:21:00.000 | -1 | 0 | 0 | 0 | python,ms-access | 31,059,064 | 6 | false | 0 | 0 | File --> Options --> Current Database -> Check below options
* Use the Cache format that is compatible with Microsoft Access 2010 and later
* Clear Cache on Close
Then, you file will be saved by compacting to the original size. | 4 | 1 | 0 | I have a database which I regularly need to import large amounts of data into via some python scripts. Compacted, the data for a single months imports takes about 280mb, but during the import file size swells to over a gb.
Given the 2gb size limit on mdb files, this is a bit of a concern. Apart from breaking the insert... | MS-Access Database getting very large during inserts | -0.033321 | 1 | 0 | 3,989 |
1,650,856 | 2009-10-30T16:21:00.000 | 3 | 0 | 0 | 0 | python,ms-access | 1,650,897 | 6 | false | 0 | 0 | A common trick, if feasible with regard to the schema and semantics of the application, is to have several MDB files with Linked tables.
Also, the way the insertions take place matters with regards to the way the file size balloons... For example: batched, vs. one/few records at a time, sorted (relative to particular ... | 4 | 1 | 0 | I have a database which I regularly need to import large amounts of data into via some python scripts. Compacted, the data for a single months imports takes about 280mb, but during the import file size swells to over a gb.
Given the 2gb size limit on mdb files, this is a bit of a concern. Apart from breaking the insert... | MS-Access Database getting very large during inserts | 0.099668 | 1 | 0 | 3,989 |
1,650,856 | 2009-10-30T16:21:00.000 | 3 | 0 | 0 | 0 | python,ms-access | 1,651,412 | 6 | false | 0 | 0 | One thing to watch out for is records which are present in the append queries but aren't inserted into the data due to duplicate key values, null required fields, etc. Access will allocate the space taken by the records which aren't inserted.
About the only significant thing I'm aware of is to ensure you have exclusi... | 4 | 1 | 0 | I have a database which I regularly need to import large amounts of data into via some python scripts. Compacted, the data for a single months imports takes about 280mb, but during the import file size swells to over a gb.
Given the 2gb size limit on mdb files, this is a bit of a concern. Apart from breaking the insert... | MS-Access Database getting very large during inserts | 0.099668 | 1 | 0 | 3,989 |
1,653,071 | 2009-10-31T01:18:00.000 | 0 | 0 | 0 | 0 | python,django,search,sphinx,django-sphinx | 2,657,021 | 2 | false | 1 | 0 | The above sounds right to me, though I'll mention that you could call the indexer from your save function for the object.
It'd probably get called a LOT, but it could work. Just call it as you would any external command. | 1 | 2 | 0 | I just setup django-sphinx, and it is working beautifully. I am now able to search my model and get amazing results. The one problem is that I have to build the index by hand using the indexer command. That means every time I add new content, I have to manually hit the command line to rebuild the search index. That is ... | How do I automatically rebuild the Sphinx index under django-sphinx? | 0 | 0 | 0 | 2,816 |
1,653,153 | 2009-10-31T01:55:00.000 | 0 | 0 | 1 | 0 | python,macos,installation,pyobjc | 1,653,175 | 3 | false | 0 | 0 | If your goal is to write software that will work on other people's computers, you shouldn't touch the default Python installation. If you simply cannot live without 2.6, then you're responsible for re-creating everything on your own, and that's not going to be a point-and-click process by any means. | 2 | 1 | 0 | OS X 10.5.8 came with Python 2.5, and had PyObjC already installed.
I installed Python 2.6 from the python.org site, and PyObjC isn't there.
I can't find a download to install PyObjC on my Python 2.6 install. Is checking out the PyObjC trunk and trying to build it my only choice? Will that work "out of the box"? | Install PyObjC on Python 2.6 on OS X 10.5? | 0 | 0 | 0 | 3,234 |
1,653,153 | 2009-10-31T01:55:00.000 | 1 | 0 | 1 | 0 | python,macos,installation,pyobjc | 1,655,073 | 3 | false | 0 | 0 | You should probably try to build PyObjC from trunk, which will work fine on the official Python 2.6 distribution, but not on Python 2.5. There are quite a lot of fixes in the trunk right now that weren't in 2.2b2, which afaik. is the most current version available through easy_install.
There are some little snags that... | 2 | 1 | 0 | OS X 10.5.8 came with Python 2.5, and had PyObjC already installed.
I installed Python 2.6 from the python.org site, and PyObjC isn't there.
I can't find a download to install PyObjC on my Python 2.6 install. Is checking out the PyObjC trunk and trying to build it my only choice? Will that work "out of the box"? | Install PyObjC on Python 2.6 on OS X 10.5? | 0.066568 | 0 | 0 | 3,234 |
1,653,419 | 2009-10-31T04:34:00.000 | 0 | 0 | 1 | 0 | java,python,cross-platform,wxpython,multiplatform | 1,653,442 | 11 | false | 0 | 1 | Java seems better for what you want.
Well what about the web application in Javascript? | 6 | 3 | 0 | For the program idea I have, it requires that the software be written in one binary that is executeable by all major desktop platforms, meaning it needs an interpreted language or a language within a JVM. Either is fine with me, but the programming language has to balance power & simplicity (e.g. Python)
I know of wxPy... | Cross-Platform Programming Language with a decent gui toolkit? | 0 | 0 | 0 | 3,320 |
1,653,419 | 2009-10-31T04:34:00.000 | 0 | 0 | 1 | 0 | java,python,cross-platform,wxpython,multiplatform | 1,681,376 | 11 | false | 0 | 1 | I would suggest going the wxPython route, I know that wxWidgets (which is what wxPython is using) can be made to have great looking Mac apps (look at PgAdmin3 from postgresql). While PgAdmin3 is not done in python, it was done with wxWidgets and looks fine on a mac. | 6 | 3 | 0 | For the program idea I have, it requires that the software be written in one binary that is executeable by all major desktop platforms, meaning it needs an interpreted language or a language within a JVM. Either is fine with me, but the programming language has to balance power & simplicity (e.g. Python)
I know of wxPy... | Cross-Platform Programming Language with a decent gui toolkit? | 0 | 0 | 0 | 3,320 |
1,653,419 | 2009-10-31T04:34:00.000 | 1 | 0 | 1 | 0 | java,python,cross-platform,wxpython,multiplatform | 1,656,477 | 11 | false | 0 | 1 | I think wxPython is pretty good, though I am not sure what you mean by "support on Mac OS X is fairly limited" but I have been porting a wxPython app (www.mockupscreens.com) to Mac and it wasn't that difficult with few tweaks e.g. some UI elements may not come up as you expected, as wxPython uses native UI elements, wh... | 6 | 3 | 0 | For the program idea I have, it requires that the software be written in one binary that is executeable by all major desktop platforms, meaning it needs an interpreted language or a language within a JVM. Either is fine with me, but the programming language has to balance power & simplicity (e.g. Python)
I know of wxPy... | Cross-Platform Programming Language with a decent gui toolkit? | 0.01818 | 0 | 0 | 3,320 |
1,653,419 | 2009-10-31T04:34:00.000 | 1 | 0 | 1 | 0 | java,python,cross-platform,wxpython,multiplatform | 1,653,436 | 11 | false | 0 | 1 | I work on a program that has to run on Windows, Linux and OS X (and OS X is my development platform), and wxPython is what we use.
If I had a chance to start again, I'd probably go with PyQT (based on advice from friends), but wxPython will get the job done. | 6 | 3 | 0 | For the program idea I have, it requires that the software be written in one binary that is executeable by all major desktop platforms, meaning it needs an interpreted language or a language within a JVM. Either is fine with me, but the programming language has to balance power & simplicity (e.g. Python)
I know of wxPy... | Cross-Platform Programming Language with a decent gui toolkit? | 0.01818 | 0 | 0 | 3,320 |
1,653,419 | 2009-10-31T04:34:00.000 | 0 | 0 | 1 | 0 | java,python,cross-platform,wxpython,multiplatform | 1,681,426 | 11 | false | 0 | 1 | I use three cross-platform tools regularly: Realbasic from Realsoftware which is what Visual Basic v6 would have been if allowed to grow; Revolution from Runrev which is what Hypercard would have been if allowed to survive (and its neat using a scripting language whose syntax is basically English); and finally, Delphi ... | 6 | 3 | 0 | For the program idea I have, it requires that the software be written in one binary that is executeable by all major desktop platforms, meaning it needs an interpreted language or a language within a JVM. Either is fine with me, but the programming language has to balance power & simplicity (e.g. Python)
I know of wxPy... | Cross-Platform Programming Language with a decent gui toolkit? | 0 | 0 | 0 | 3,320 |
1,653,419 | 2009-10-31T04:34:00.000 | 6 | 0 | 1 | 0 | java,python,cross-platform,wxpython,multiplatform | 1,653,433 | 11 | true | 0 | 1 | I used Python with wxPython for quite a while and found it very easy to use. I now use Java with both Swing and SWT.
I prefer Java but that's just a personal preference so you shouldn't let that sway you.
I didn't find the transition from Python to Java that difficult. In terms of GUI, they both have the layout manager... | 6 | 3 | 0 | For the program idea I have, it requires that the software be written in one binary that is executeable by all major desktop platforms, meaning it needs an interpreted language or a language within a JVM. Either is fine with me, but the programming language has to balance power & simplicity (e.g. Python)
I know of wxPy... | Cross-Platform Programming Language with a decent gui toolkit? | 1.2 | 0 | 0 | 3,320 |
1,653,734 | 2009-10-31T07:55:00.000 | 0 | 0 | 1 | 0 | python,python-2.6 | 1,653,756 | 5 | false | 1 | 0 | I think Python 2.5 apps should work fine in 2.6 without updates. 2.6 might complain about some deprecated functionality but those are only removed in 3.0 and still work in 2.6. | 3 | 3 | 0 | I have a Django app written in Python 2.5 and I plan to upgrade it to be compatible with Python 2.6. It contains hundreds of .py files. Is there a simple way to find all deprecated functions in those files? | Python deprecated functions | 0 | 0 | 0 | 4,339 |
1,653,734 | 2009-10-31T07:55:00.000 | 5 | 0 | 1 | 0 | python,python-2.6 | 1,653,810 | 5 | false | 1 | 0 | Between point releases of Python (like between 2.5 and 2.6) anything that might break is a warning for at least one release. Most deprecation warnings are emitted by default but you have fine-grained control over the emitted warnings with the -W interpreter invocation option.
This is a relatively small issue between po... | 3 | 3 | 0 | I have a Django app written in Python 2.5 and I plan to upgrade it to be compatible with Python 2.6. It contains hundreds of .py files. Is there a simple way to find all deprecated functions in those files? | Python deprecated functions | 0.197375 | 0 | 0 | 4,339 |
1,653,734 | 2009-10-31T07:55:00.000 | 0 | 0 | 1 | 0 | python,python-2.6 | 8,189,947 | 5 | false | 1 | 0 | More and more I am persuaded that the right answer is "Just run your testsuite to find out." You have your testsuite covering your program reasonably, right? If not, this is a great opportunity to create one (you can persuade your point-headed boss that it is "migration" ;)). | 3 | 3 | 0 | I have a Django app written in Python 2.5 and I plan to upgrade it to be compatible with Python 2.6. It contains hundreds of .py files. Is there a simple way to find all deprecated functions in those files? | Python deprecated functions | 0 | 0 | 0 | 4,339 |
1,653,897 | 2009-10-31T09:38:00.000 | 7 | 0 | 1 | 0 | python | 1,654,390 | 5 | false | 0 | 0 | Contra the other answers offered, I believe that we can make a strong argument about the recoverability of a pickle. That answer is: "Yes, an incomplete pickle always leads to an exception."
Why are we able to do this? Because the "pickle" format is in fact a small stack-based language. In a stack-based language you wr... | 4 | 4 | 1 | Suppose my attempt to write a pickle object out to disk is incomplete due to a crash. Will an attempt to unpickle the object always lead to an exception or is it possible that the fragment that was written out may be interpreted as valid pickle and the error go unnoticed? | If pickling was interrupted, will unpickling necessarily always fail? - Python | 1 | 0 | 0 | 1,351 |
1,653,897 | 2009-10-31T09:38:00.000 | 1 | 0 | 1 | 0 | python | 1,654,321 | 5 | false | 0 | 0 | I doubt you could make a claim that it will always lead to an exception. Pickles are actually programs written in a specialized stack language. The internal details of pickles change from version to version, and new pickle protocols are added occasionally. The state of the pickle after a crash, and the resulting eff... | 4 | 4 | 1 | Suppose my attempt to write a pickle object out to disk is incomplete due to a crash. Will an attempt to unpickle the object always lead to an exception or is it possible that the fragment that was written out may be interpreted as valid pickle and the error go unnoticed? | If pickling was interrupted, will unpickling necessarily always fail? - Python | 0.039979 | 0 | 0 | 1,351 |
1,653,897 | 2009-10-31T09:38:00.000 | 1 | 0 | 1 | 0 | python | 1,654,503 | 5 | false | 0 | 0 | To be sure that you have a "complete" pickle file, you need to pickle three things.
Pickle a header of some kind that claims how many objects and what the end-of-file flag will look like. A tuple of an integer and the EOF string, for example.
Pickle the objects you actually care about. The count is given by the head... | 4 | 4 | 1 | Suppose my attempt to write a pickle object out to disk is incomplete due to a crash. Will an attempt to unpickle the object always lead to an exception or is it possible that the fragment that was written out may be interpreted as valid pickle and the error go unnoticed? | If pickling was interrupted, will unpickling necessarily always fail? - Python | 0.039979 | 0 | 0 | 1,351 |
1,653,897 | 2009-10-31T09:38:00.000 | 2 | 0 | 1 | 0 | python | 1,654,329 | 5 | false | 0 | 0 | Pickling an object returns an str object, or writes an str object to a file ... it doesn't modify the original object. If a "crash" (exception) happens inside a pickling call, the result won't be returned to the caller, so you don't have anything that you could try to unpickle. Besides, why would you want to unpickle s... | 4 | 4 | 1 | Suppose my attempt to write a pickle object out to disk is incomplete due to a crash. Will an attempt to unpickle the object always lead to an exception or is it possible that the fragment that was written out may be interpreted as valid pickle and the error go unnoticed? | If pickling was interrupted, will unpickling necessarily always fail? - Python | 0.07983 | 0 | 0 | 1,351 |
1,654,520 | 2009-10-31T14:23:00.000 | 0 | 0 | 1 | 1 | shell,command,python-idle,python-2.5 | 1,654,569 | 2 | false | 0 | 0 | check if there is ipython available on windows .. that offers line history, tab completion and many other nice features | 2 | 0 | 0 | I'm using python 2.5 in windows on a macbook pro with IDLE. How do I get previously typed commands in the python shell? In other operating systems I've managed to do this using 'ctrl' + 'up arrow' or a similar combination. I've tried all likely combinations without success.
Thanks. | getting previously typed commands in python | 0 | 0 | 0 | 794 |
1,654,520 | 2009-10-31T14:23:00.000 | 0 | 0 | 1 | 1 | shell,command,python-idle,python-2.5 | 1,654,586 | 2 | true | 0 | 0 | I just realized that I can find this out in 'Options -> Configure IDLE -> Keys'
It's 'alt + p' for IDLE. Thanks for the suggestion pfote - I will take a look. | 2 | 0 | 0 | I'm using python 2.5 in windows on a macbook pro with IDLE. How do I get previously typed commands in the python shell? In other operating systems I've managed to do this using 'ctrl' + 'up arrow' or a similar combination. I've tried all likely combinations without success.
Thanks. | getting previously typed commands in python | 1.2 | 0 | 0 | 794 |
1,654,759 | 2009-10-31T15:48:00.000 | 11 | 0 | 0 | 1 | python,google-app-engine,erlang | 1,654,786 | 1 | true | 1 | 0 | Erlang and Python are programming languages, and each language has one or more "runtimes" that allow you to run programs written in those languages. GAE supplies a Python runtime.
GAE has no support for Erlang programs. | 1 | 2 | 0 | I know python can be run on GAE
what is different erlang and python in lay man term?
can erlang run on google app engine ? | erlang on google app engine? | 1.2 | 0 | 0 | 1,713 |
1,654,922 | 2009-10-31T16:53:00.000 | 1 | 0 | 0 | 1 | python | 2,246,627 | 3 | false | 0 | 0 | Monitor the overall server load (say, load average or equivalent of vmstat) in python?
>>> import psutil, subprocess
>>> subp = subprocess.Popen('python', stdout=subprocess.PIPE, stderr=subprocess.PIPE)
>>> proc = psutil.Process(subp.pid)
>>> rss, vms = proc.get_memory_info()
>>> print "Resident memory: %s KB" %(rss ... | 1 | 4 | 0 | I have a queue of workers that spawn external third party apps using subprocess. I'd like to control how much of the overall resources of my server these process consume. Some of these external apps also tend to hang for unknown reasons, fixed with a restart.
What's a good way to:
Monitor the overall server load (say,... | Python: Monitoring and killing/throttling spawned processes based on load, time, etc | 0.066568 | 0 | 0 | 2,059 |
1,655,927 | 2009-10-31T23:34:00.000 | 0 | 0 | 0 | 1 | python,macos,usb | 1,655,945 | 1 | false | 0 | 0 | You're confusing the term device with the term volume--in this example (and in most real world situations) there would only be one device involved.
The state of most hardware falls under the purview of IOKit, and the only way you can possibly get to this information from Python is through careful parsing of the ioreg ... | 1 | 1 | 0 | Ok, so here's the setup. In OS X (>= 10.5), is it possible, given a mounted usb device with a known location, say /Volumes/FLASHDRIVE, to find out whether this device is connecting through another usb device (a card reader for example) and if so, which one.
Ideally, this could all be done in python, but if not that's ... | Querying the connecting device for usb devices in OS X | 0 | 0 | 0 | 477 |
1,656,859 | 2009-11-01T10:48:00.000 | 4 | 0 | 1 | 0 | python,regex,recursion | 1,656,944 | 5 | false | 0 | 0 | You can't do it with a regexp. Python doesn't support recursive regexp | 1 | 15 | 0 | I'm interested how can be implemented recursive regexp matching in Python (I've not found any examples :( ). For example how would one write expression which matches "bracket balanced" string like "foo(bar(bar(foo)))(foo1)bar1" | How can a recursive regexp be implemented in python? | 0.158649 | 0 | 0 | 8,412 |
1,658,829 | 2009-11-01T23:54:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine,gql | 1,660,404 | 1 | true | 0 | 0 | I'm not aware of any libraries that do that. You may want to reconsider what you're doing, at least in terms of retrieving more than 1000 results - those operations are not available because they're expensive, and needing to evade them is usually (though not always) a sign that you need to rearchitect your app to do le... | 1 | 0 | 0 | I am after a Python module for Google App Engine that abstracts away limitations of the GQL.
Specifically I want to store big files (> 1MB) and retrieve all records for a model (> 1000). I have my own code that handles this at present but would prefer to build on existing work, if available.
Thanks | module to abstract limitations of GQL | 1.2 | 1 | 0 | 78 |
1,659,283 | 2009-11-02T03:16:00.000 | 1 | 1 | 0 | 1 | python,macos,serial-port | 1,659,294 | 2 | false | 0 | 0 | What about just doing the os.listdir / glob equivalent of ls to perform the equivalent of that ls? Of course it's not going to be the case that some usable device is connected to each such special file (but, that holds for ls as well;-), but for "finding all serial ports", as you ask in your Q's title, I'm not sure ho... | 1 | 3 | 0 | I am looking for a solution to programmatically return all available serial ports with python.
At the moment I am entering ls /dev/tty.* or ls /dev/cu.* into the terminal to list ports and hardcoding them into the pyserial class. | MacPython: programmatically finding all serial ports | 0.099668 | 0 | 0 | 2,216 |
1,659,380 | 2009-11-02T04:06:00.000 | 0 | 0 | 0 | 0 | python,xml,twisted | 1,682,249 | 2 | false | 0 | 0 | You only need to parse a single URL? Then don't worry. Use urllib2 to open the connection and pass the file handle into ElementTree.
Variations you can try would be to use ElementTree's incremental parser or to use iterparse, but that depends on what your real requirements are. There's "super fast" but there's also "fa... | 1 | 3 | 0 | I want a fast way to grab a URL and parse it while streaming. Ideally this should be super fast. My language of choice is Python. I have an intuition that twisted can do this but I'm at a loss to find an example. | How do I fetch an XML document and parse it with Python twisted? | 0 | 0 | 1 | 1,573 |
1,659,559 | 2009-11-02T05:33:00.000 | 0 | 1 | 1 | 0 | python,scripting | 1,659,616 | 8 | false | 0 | 0 | I would try a number of "scripting" languages (as well as some languages with good static type inference), and then select the language(s) that best fit the problem.
This may be for a number of reasons including, but not limited to: Runtime targets and performance (as dictated by functional requirements), library suppo... | 6 | 3 | 0 | If you have to choose a scripting language, why would you choose Python? | What makes Python a good scripting language? | 0 | 0 | 0 | 11,442 |
1,659,559 | 2009-11-02T05:33:00.000 | 2 | 1 | 1 | 0 | python,scripting | 1,659,629 | 8 | false | 0 | 0 | I think it depends on your definition of scripting language. There are (at least) two camps. One is that scripting language should be embeddable, so the core should be small (like Lua or Tcl). The second camp is scripting for system administration, and Perl is definitely in this camp.
Python is a general programming l... | 6 | 3 | 0 | If you have to choose a scripting language, why would you choose Python? | What makes Python a good scripting language? | 0.049958 | 0 | 0 | 11,442 |
1,659,559 | 2009-11-02T05:33:00.000 | 0 | 1 | 1 | 0 | python,scripting | 1,659,630 | 8 | false | 0 | 0 | I haven't programmed in python before but my guess would be the libraries available and the size of the userbase. | 6 | 3 | 0 | If you have to choose a scripting language, why would you choose Python? | What makes Python a good scripting language? | 0 | 0 | 0 | 11,442 |
1,659,559 | 2009-11-02T05:33:00.000 | 0 | 1 | 1 | 0 | python,scripting | 1,698,597 | 8 | false | 0 | 0 | It's very intuitive, has a ton of libraries, helps you whip up a script VERY FAST. You can use it for small projects or big projects and can compile into an EXE for windows, an APP for mac or into a cross platform application.
I has possibly the cleanest syntax of any language I have seen to date and can do everything ... | 6 | 3 | 0 | If you have to choose a scripting language, why would you choose Python? | What makes Python a good scripting language? | 0 | 0 | 0 | 11,442 |
1,659,559 | 2009-11-02T05:33:00.000 | 11 | 1 | 1 | 0 | python,scripting | 1,659,617 | 8 | false | 0 | 0 | Depends on what you mean by "scripting language". If you mean I'm going to be extensively typing it in at a shell prompt, I want the mysterious but utter conciseness of Bash or zsh; if you mean I'm going to have to embed it in 2000 apps in each of which it will typically be used for "customization" scripts of 2 or 3 l... | 6 | 3 | 0 | If you have to choose a scripting language, why would you choose Python? | What makes Python a good scripting language? | 1 | 0 | 0 | 11,442 |
1,659,559 | 2009-11-02T05:33:00.000 | 20 | 1 | 1 | 0 | python,scripting | 1,659,564 | 8 | true | 0 | 0 | Because it has clean and agile syntax, it's fast, well documented, well connected to C, has a lot of libraries, it's intuitive, and it's not perl. | 6 | 3 | 0 | If you have to choose a scripting language, why would you choose Python? | What makes Python a good scripting language? | 1.2 | 0 | 0 | 11,442 |
1,659,620 | 2009-11-02T05:55:00.000 | 4 | 1 | 1 | 0 | python,oop,animation | 1,659,774 | 7 | false | 0 | 0 | A few other points I've not seen in the existing answers:
it's free
it's fast [enough]
it runs on every platform I know of (AIX, HPUX, Linux, Mac OS X, Windows..)
quick to learn
large, powerful libraries
numeric
graphical
etc
simple, consistent syntax
the existing user-base is large
because it's easy-to-learn, you... | 4 | 1 | 0 | What is that needs to be coded in Python instead of C/C++ etc? I know its advantages etc. I want to know why exactly makes Python The language for people in this industry? | Why is Python a favourite among people working in animation industry? | 0.113791 | 0 | 0 | 1,359 |
1,659,620 | 2009-11-02T05:55:00.000 | 3 | 1 | 1 | 0 | python,oop,animation | 1,659,654 | 7 | false | 0 | 0 | Because Python is what Basic should have been ;)
Its a language designed from the beginning to be used by non-programmers, but with the power to be truly used as a general purpose programming language. | 4 | 1 | 0 | What is that needs to be coded in Python instead of C/C++ etc? I know its advantages etc. I want to know why exactly makes Python The language for people in this industry? | Why is Python a favourite among people working in animation industry? | 0.085505 | 0 | 0 | 1,359 |
1,659,620 | 2009-11-02T05:55:00.000 | 2 | 1 | 1 | 0 | python,oop,animation | 1,659,703 | 7 | false | 0 | 0 | Aside from the fact that it's already in use, the main advantage is that it's quick to use. Java, C, and friends almost all require tedious coding that merely restates what you already know. Python is designed to be quick to write, quick to modify, and as general as possible.
As an example, functions in java require yo... | 4 | 1 | 0 | What is that needs to be coded in Python instead of C/C++ etc? I know its advantages etc. I want to know why exactly makes Python The language for people in this industry? | Why is Python a favourite among people working in animation industry? | 0.057081 | 0 | 0 | 1,359 |
1,659,620 | 2009-11-02T05:55:00.000 | 1 | 1 | 1 | 0 | python,oop,animation | 1,659,637 | 7 | false | 0 | 0 | My guess is that it is the tool for the job because it is easy to prototype extra features. | 4 | 1 | 0 | What is that needs to be coded in Python instead of C/C++ etc? I know its advantages etc. I want to know why exactly makes Python The language for people in this industry? | Why is Python a favourite among people working in animation industry? | 0.028564 | 0 | 0 | 1,359 |
1,660,049 | 2009-11-02T08:38:00.000 | 3 | 1 | 0 | 0 | python,unit-testing,mocking,corba | 1,660,185 | 3 | true | 0 | 0 | Don't try to unittest Corba. Assume that Corba works. Unittest your own code. This means:
Create a unit test which checks that you correctly set up Corba and that you can invoke a single method and read a property. If that works, all other methods and properties will work, too.
After that, test that all the exposed ob... | 3 | 2 | 0 | I am interested in your opinions on unittesting code that uses Corba to communicate with a server.
Would you mock the Corba objects? In Python that's sort of a pain in the ass because all the methods of Corba objects are loaded dynamically. So you're basically stuck with "mock anything".
Thanks!
Note:
I believe I have ... | Unittesting Corba in Python | 1.2 | 0 | 1 | 625 |
1,660,049 | 2009-11-02T08:38:00.000 | 1 | 1 | 0 | 0 | python,unit-testing,mocking,corba | 1,660,187 | 3 | false | 0 | 0 | I would set up a test server, and do live tests on that. Unittesting can be tricky with network stuff, so it's best to keep it as real as possible. Any mocking would be done on the test server, for instance if you need to communicate to three different servers, it could be set up with three different IP addresses to pl... | 3 | 2 | 0 | I am interested in your opinions on unittesting code that uses Corba to communicate with a server.
Would you mock the Corba objects? In Python that's sort of a pain in the ass because all the methods of Corba objects are loaded dynamically. So you're basically stuck with "mock anything".
Thanks!
Note:
I believe I have ... | Unittesting Corba in Python | 0.066568 | 0 | 1 | 625 |
1,660,049 | 2009-11-02T08:38:00.000 | 0 | 1 | 0 | 0 | python,unit-testing,mocking,corba | 51,438,774 | 3 | false | 0 | 0 | I have got similar work to tackle but I probably will not write a test for implementation of CORBA objects or more specifically COM objects (implementation of CORBA). I have to write tests for work that uses these structures as oppose to the structures themselves (although I could land myself in that role too if I ask ... | 3 | 2 | 0 | I am interested in your opinions on unittesting code that uses Corba to communicate with a server.
Would you mock the Corba objects? In Python that's sort of a pain in the ass because all the methods of Corba objects are loaded dynamically. So you're basically stuck with "mock anything".
Thanks!
Note:
I believe I have ... | Unittesting Corba in Python | 0 | 0 | 1 | 625 |
1,660,351 | 2009-11-02T10:00:00.000 | 1 | 0 | 1 | 0 | python | 1,660,361 | 4 | false | 0 | 0 | If you have a limited number of options your planning to use, you could set up a dictionary with string keys and values of the functions/classes. | 1 | 1 | 0 | How can I pass a functions name to a function and then call it?
Is it possible to do this without using getattribute?
How can I pass a class name to a function and then instantiate the class?
I know I just could pass the instance of the class directly to the function but it is important that the class gets instantiated... | How can I pass a function's name to a function, and then call it? | 0.049958 | 0 | 0 | 285 |
1,660,474 | 2009-11-02T10:27:00.000 | 9 | 0 | 0 | 0 | python,qt,pyqt | 1,692,893 | 3 | false | 1 | 1 | Yes, PyQt uses Model/View concept (officially without the "Controller" part), but may be you have a somewhat distorted picture what does it mean in PyQt.
There are two parts:
Models, subclassed from appropriate PyQt base abstract model classes (QAbstractItemModel, QAbstractTableModel, QAbstractListModel, etc.). These ... | 1 | 35 | 0 | I am trying to design an MVC-pattern with PyQt.
I want to split all programs into 3 parts:
classes abstracted from all Qt classes (model)
classes providing data from the model to a Qt app (controller)
the Qt app itself with defined method SignalsToSlots that connects signals with controller.
Is this optimally? What s... | PyQt and MVC-pattern | 1 | 0 | 0 | 29,014 |
1,661,479 | 2009-11-02T14:01:00.000 | 13 | 0 | 0 | 0 | python,r,matplotlib,scipy,data-visualization | 1,662,207 | 2 | true | 0 | 0 | This is a tough one to answer.
I recently switched some of my graphing workload from R to matplotlib. In my humble opinion, I find matplotlib's graphs to be prettier (better default colors, they look crisper and more modern). I also think matplotlib renders PNGs a whole lot better.
The real motivation for me though... | 2 | 11 | 1 | I regularly make figures (the exploratory data analysis type) in R. I also program in Python and was wondering if there are features or concepts in matplotlib that would be worth learning. For instance, I am quite happy with R - but its image() function will produce large files with pixelated output, whereas Matlab's e... | matplotlib for R user? | 1.2 | 0 | 0 | 10,755 |
1,661,479 | 2009-11-02T14:01:00.000 | 4 | 0 | 0 | 0 | python,r,matplotlib,scipy,data-visualization | 1,662,225 | 2 | false | 0 | 0 | I think that the largest advantage is that matplotlib is based on Python, which you say you already know. So, this is one language less to learn. Just spend the time mastering Python, and you'll benefit both directly for the plotting task at hand and indirectly for your other Python needs.
Besides, IMHO Python is an o... | 2 | 11 | 1 | I regularly make figures (the exploratory data analysis type) in R. I also program in Python and was wondering if there are features or concepts in matplotlib that would be worth learning. For instance, I am quite happy with R - but its image() function will produce large files with pixelated output, whereas Matlab's e... | matplotlib for R user? | 0.379949 | 0 | 0 | 10,755 |
1,662,140 | 2009-11-02T15:58:00.000 | 17 | 0 | 1 | 0 | python,datetime | 1,662,154 | 3 | true | 0 | 0 | Use a simple trick: Set the date to the first of the next month and then subtract one second/hour/day/as much as you need. | 1 | 4 | 0 | How to create datetime object representing the very last moment of the current month ? | python's datetime and end of the month | 1.2 | 0 | 0 | 2,347 |
1,662,576 | 2009-11-02T17:22:00.000 | 15 | 0 | 1 | 1 | python,windows,python-idle | 1,662,586 | 2 | true | 0 | 0 | On my system, running C:\Python26\lib\idlelib\idle.py launches idle from the command prompt. Obviously you will need to adjust your path if your main Python directory isn't C:\Python26\.
It looks like you could also launch it via idle.pyw or idle.bat in that same directory. | 2 | 8 | 0 | I messed up my IDLE shortcut. What is the way to start IDLE from the cmd.exe shell in Windows? | Running Python's IDLE in windows | 1.2 | 0 | 0 | 31,240 |
1,662,576 | 2009-11-02T17:22:00.000 | 2 | 0 | 1 | 1 | python,windows,python-idle | 12,381,743 | 2 | false | 0 | 0 | You can just add a path in your Environment variables tab in My Computer Properties --> Advanced as c:\Python27\Lib\idlelib. After adding this path just write idle.pyw in cmd whenever you want to run IDLE.
Just make sure you replace the folder name with whatever directory name you have. | 2 | 8 | 0 | I messed up my IDLE shortcut. What is the way to start IDLE from the cmd.exe shell in Windows? | Running Python's IDLE in windows | 0.197375 | 0 | 0 | 31,240 |
1,663,762 | 2009-11-02T21:18:00.000 | 3 | 0 | 1 | 0 | python,nltk | 1,663,990 | 2 | false | 0 | 0 | Looks like the nltp package doesn't have a tokenizer package.
A quick look on the NLTK website suggests that from nltp.tokenize import * is what you're after. | 1 | 0 | 0 | I'm very new to Python, and am trying to learn in conjunction with using nltk.
I've been following some examples and testing things out, but it seems I am very limited in what I can do due to errors being returned by python.
I know nltk is installed and importing fine, because this code works
from nltk.sem import ch... | tokenizer errors with nltk | 0.291313 | 0 | 0 | 4,537 |
1,664,812 | 2009-11-03T02:09:00.000 | 2 | 0 | 1 | 0 | python,distutils | 1,664,857 | 3 | false | 0 | 0 | As distributed, distutils don't know about assembly code, and I don't know of extensions to it that let it deal automatically with it. In a similar situation I've always built the library separately (with C and assembly as needed and feasible) and only used the resulting .a with setup.py. | 1 | 5 | 0 | I wrote a small Python extension that bundles, compiles and statically links with a small C library with one optional .S (assembler) file. Distutils's Extension() doesn't recognize the .S by default. Is there a good way to compile that file, or should I just shell out to make? Right now I compile the C code only for a ... | Can Python's distutils compile .S (assembly)? | 0.132549 | 0 | 0 | 384 |
1,665,288 | 2009-11-03T04:40:00.000 | 2 | 0 | 0 | 0 | python,pygtk,pango | 1,772,990 | 2 | true | 0 | 1 | I found some related examples: KeepNote, which has a custom rich edit, and Rednotebook which implements KeepNote's richedit. | 1 | 1 | 0 | I am looking for an example application written in Python and PyGTK.
There should be an editor out there somewhere that already does this.
Some app with a text editor row of buttons:
- Font
- Bold/italic/underline
- etc
I am hoping to avoid reinventing the wheel on this one!
thanks | Are there any examples of a Python PyGTK Pango editor toolbar? | 1.2 | 0 | 0 | 1,341 |
1,666,482 | 2009-11-03T10:27:00.000 | 1 | 0 | 1 | 0 | python,deployment,setuptools,distutils | 1,666,911 | 6 | true | 0 | 0 | You can't assume it's installed. There are ways around that, you can fall back to distutils (but then why have setuptools in the first place) or you can install setuptools in setup.py (but I think that's evil).
Use setuptools only if you need it.
When it comes to setuptools vs distrubute, they are compatible, and choos... | 5 | 3 | 0 | I'm just learning the art of writing a setup.py file for my project. I see there's lots of talk about setuptools, which is supposed to be superior to distutils. There's one thing though that I fail to understand, and I didn't see it addressed in any tutorial I've read about this: What if setuptools isn't installed? I u... | What if setuptools isn't installed? | 1.2 | 0 | 0 | 1,621 |
1,666,482 | 2009-11-03T10:27:00.000 | 4 | 0 | 1 | 0 | python,deployment,setuptools,distutils | 1,666,595 | 6 | false | 0 | 0 | The standard way to distribute packages with setuptools includes an ez_setup.py script which will automatically download and install setuptools itself - on Windows I believe it will actually install an executable for easy_install. You can get this from the standard setuptools/easy_install distribution. | 5 | 3 | 0 | I'm just learning the art of writing a setup.py file for my project. I see there's lots of talk about setuptools, which is supposed to be superior to distutils. There's one thing though that I fail to understand, and I didn't see it addressed in any tutorial I've read about this: What if setuptools isn't installed? I u... | What if setuptools isn't installed? | 0.132549 | 0 | 0 | 1,621 |
1,666,482 | 2009-11-03T10:27:00.000 | 0 | 0 | 1 | 0 | python,deployment,setuptools,distutils | 1,666,606 | 6 | false | 0 | 0 | I would say it depends on what kind of user you are addressing.
If they are simply users and not Python programmers, or if they are basic programmers, using setuptools might be a little bit too much at first. For those the distutils is perfect.
For clients, I would definitely stick to distutils.
For more enthusiast pro... | 5 | 3 | 0 | I'm just learning the art of writing a setup.py file for my project. I see there's lots of talk about setuptools, which is supposed to be superior to distutils. There's one thing though that I fail to understand, and I didn't see it addressed in any tutorial I've read about this: What if setuptools isn't installed? I u... | What if setuptools isn't installed? | 0 | 0 | 0 | 1,621 |
1,666,482 | 2009-11-03T10:27:00.000 | 2 | 0 | 1 | 0 | python,deployment,setuptools,distutils | 1,698,562 | 6 | false | 0 | 0 | I have used setuptools to compile many python scripts that I have written into windows EXEs. However, it has always been my understanding (from experience) that the computer running the compiled EXE does not need to have setup tools installed.
Hope that helps | 5 | 3 | 0 | I'm just learning the art of writing a setup.py file for my project. I see there's lots of talk about setuptools, which is supposed to be superior to distutils. There's one thing though that I fail to understand, and I didn't see it addressed in any tutorial I've read about this: What if setuptools isn't installed? I u... | What if setuptools isn't installed? | 0.066568 | 0 | 0 | 1,621 |
1,666,482 | 2009-11-03T10:27:00.000 | 2 | 0 | 1 | 0 | python,deployment,setuptools,distutils | 1,666,592 | 6 | false | 0 | 0 | In most librarys I ever installed for python, a warning apears "You have to install setuptools". You could do it as well I think, you could add a link so the user don't have to search the internet for it. | 5 | 3 | 0 | I'm just learning the art of writing a setup.py file for my project. I see there's lots of talk about setuptools, which is supposed to be superior to distutils. There's one thing though that I fail to understand, and I didn't see it addressed in any tutorial I've read about this: What if setuptools isn't installed? I u... | What if setuptools isn't installed? | 0.066568 | 0 | 0 | 1,621 |
1,666,989 | 2009-11-03T12:18:00.000 | 0 | 0 | 1 | 0 | python,cookies,internet-explorer | 1,667,121 | 2 | false | 0 | 0 | I've found out that under Windows seven cookies are stored in
C:\Users(user)\AppData\Roaming\Microsoft\Windows\Cookies
in format (user)@host[\d].txt, so I guess just deleting the corresponding file is way to go. | 1 | 1 | 0 | how can I delete IE 8 cookies for a certain site from Python? | How to delete a certain IE cookie from python? | 0 | 0 | 0 | 605 |
1,667,257 | 2009-11-03T13:10:00.000 | -15 | 0 | 0 | 1 | python,unix | 1,667,268 | 10 | true | 0 | 0 | surely this is a nice tidy, python interface to the mount system call.
I can't find it (I thought it would just be a nice, easy os.mount()).
Surely, there is none. What would this function do on Windows?
Use the shell command instead. | 4 | 44 | 0 | I'm sure this is a easy question, my Google-fu is obviously failing me.
How do I mount a filesystem using Python, the equivalent of running the shell command mount ...?
Obviously I can use os.system to run the shell command, but surely there is a nice tidy, Python interface to the mount system call.
I can't find it. I ... | How do I mount a filesystem using Python? | 1.2 | 0 | 0 | 62,081 |
1,667,257 | 2009-11-03T13:10:00.000 | 11 | 0 | 0 | 1 | python,unix | 1,667,358 | 10 | false | 0 | 0 | Import cdll from ctypes. Then load your os libc, then use libc.mount()
Read libc's docs for mount parameters | 4 | 44 | 0 | I'm sure this is a easy question, my Google-fu is obviously failing me.
How do I mount a filesystem using Python, the equivalent of running the shell command mount ...?
Obviously I can use os.system to run the shell command, but surely there is a nice tidy, Python interface to the mount system call.
I can't find it. I ... | How do I mount a filesystem using Python? | 1 | 0 | 0 | 62,081 |
1,667,257 | 2009-11-03T13:10:00.000 | 0 | 0 | 0 | 1 | python,unix | 1,667,328 | 10 | false | 0 | 0 | Badly, mounting and unmounting belongs to the things that are highly system dependent and since they are
rarely used and
can affect system stability
There is no solution that is portable available. Since that, I agree with Ferdinand Beyer, that it is unlikely, a general Python solution is existing. | 4 | 44 | 0 | I'm sure this is a easy question, my Google-fu is obviously failing me.
How do I mount a filesystem using Python, the equivalent of running the shell command mount ...?
Obviously I can use os.system to run the shell command, but surely there is a nice tidy, Python interface to the mount system call.
I can't find it. I ... | How do I mount a filesystem using Python? | 0 | 0 | 0 | 62,081 |
1,667,257 | 2009-11-03T13:10:00.000 | 3 | 0 | 0 | 1 | python,unix | 6,963,468 | 10 | false | 0 | 0 | Note that calling your libc mount function will require root privileges; Popen(['mount'...) only will if the particular mounting isn't blessed in fstab (it is the mount executable, setuid root, that performs these checks). | 4 | 44 | 0 | I'm sure this is a easy question, my Google-fu is obviously failing me.
How do I mount a filesystem using Python, the equivalent of running the shell command mount ...?
Obviously I can use os.system to run the shell command, but surely there is a nice tidy, Python interface to the mount system call.
I can't find it. I ... | How do I mount a filesystem using Python? | 0.059928 | 0 | 0 | 62,081 |
1,670,569 | 2009-11-03T22:31:00.000 | 1 | 0 | 0 | 0 | python,soap,suds | 1,670,775 | 3 | false | 0 | 0 | I think you have to create a new Client object for each different URL. | 1 | 2 | 0 | Using SUDS SOAP client how do I specify web service URL. I can see clearly that WSDL path is specified in Client constructor but what if I wan't to change web service url? | Changing web service url in SUDS library | 0.066568 | 0 | 1 | 5,956 |
1,670,735 | 2009-11-03T23:05:00.000 | 2 | 0 | 1 | 0 | python,multithreading,chat | 1,671,922 | 3 | true | 0 | 0 | I would use the select module, or alternately twisted, however select is a bit more portable, and to my mind somewhat more pythonic. | 1 | 0 | 0 | I'm trying to write a Python lib that will implement the client side of a certain chat protocol.
After I connect to the server,
I start the main loop where I read from the server and handle received commands and here I need to call a callback function (like on_message or on file_received, etc).
How should I go abou... | python chat client lib | 1.2 | 0 | 1 | 481 |
1,672,650 | 2009-11-04T09:34:00.000 | 3 | 1 | 1 | 0 | python | 1,675,051 | 4 | true | 0 | 0 | The -h option also used to print to stderr because it is not part of the output of your program, i.e. the output is not produced by your Python script but by the Python interpreter itself.
As for why they changed the -h to use stdout? Try typing python -h with your terminal window set to the standard 24 lines. It scro... | 2 | 6 | 0 | I was writing a script to inspect python's version on my system and I've noticed that python -V writes to the error stream, while python -h, for instance, uses the standard output. Is there a good reason for this behavior? | Why does python -V write to the error stream? | 1.2 | 0 | 0 | 340 |
1,672,650 | 2009-11-04T09:34:00.000 | 2 | 1 | 1 | 0 | python | 1,673,210 | 4 | false | 0 | 0 | Why?
Because it's not the actual output of your actual script.
That's the long-standing, standard, common, typical, ordinary use for standard error: everything NOT output from your script. | 2 | 6 | 0 | I was writing a script to inspect python's version on my system and I've noticed that python -V writes to the error stream, while python -h, for instance, uses the standard output. Is there a good reason for this behavior? | Why does python -V write to the error stream? | 0.099668 | 0 | 0 | 340 |
1,673,749 | 2009-11-04T13:30:00.000 | 36 | 0 | 1 | 0 | python,regex | 1,673,804 | 2 | true | 0 | 0 | You want [^\W\d]: the group of characters that is not (either a digit or not an alphanumeric). Add an underscore in that negated set if you don't want them either.
A bit twisted, if you ask me, but it works. Should be faster than the lookahead alternative. | 1 | 9 | 0 | Using Python module re, how to get the equivalent of the "\w" (which matches alphanumeric chars) WITHOUT matching the numeric characters (those which can be matched by "[0-9]")?
Notice that the basic need is to match any character (including all unicode variation) without numerical chars (which are matched by "[0-9]").... | How to match alphabetical chars without numeric chars with Python regexp? | 1.2 | 0 | 0 | 6,224 |
1,674,696 | 2009-11-04T15:51:00.000 | 0 | 1 | 0 | 1 | python,nginx,load-balancing,wsgi,reverse-proxy | 1,718,183 | 7 | false | 0 | 0 | Another option is a queue table in the database.
The worker processes run in a loop or off cron and poll the queue table for new jobs. | 4 | 4 | 0 | I have a python (well, it's php now but we're rewriting) function that takes some parameters (A and B) and compute some results (finds best path from A to B in a graph, graph is read-only), in typical scenario one call takes 0.1s to 0.9s to complete. This function is accessed by users as a simple REST web-service (GET ... | how to process long-running requests in python workers? | 0 | 0 | 1 | 2,509 |
1,674,696 | 2009-11-04T15:51:00.000 | 0 | 1 | 0 | 1 | python,nginx,load-balancing,wsgi,reverse-proxy | 1,675,726 | 7 | false | 0 | 0 | I think you can configure modwsgi/Apache so it will have several "hot" Python interpreters
in separate processes ready to go at all times and also reuse them for new accesses
(and spawn a new one if they are all busy).
In this case you could load all the preprocessed data as module globals and they would
only get loade... | 4 | 4 | 0 | I have a python (well, it's php now but we're rewriting) function that takes some parameters (A and B) and compute some results (finds best path from A to B in a graph, graph is read-only), in typical scenario one call takes 0.1s to 0.9s to complete. This function is accessed by users as a simple REST web-service (GET ... | how to process long-running requests in python workers? | 0 | 0 | 1 | 2,509 |
1,674,696 | 2009-11-04T15:51:00.000 | 1 | 1 | 0 | 1 | python,nginx,load-balancing,wsgi,reverse-proxy | 1,682,864 | 7 | false | 0 | 0 | The most simple solution in this case is to use the webserver to do all the heavy lifting. Why should you handle threads and/or processes when the webserver will do all that for you?
The standard arrangement in deployments of Python is:
The webserver start a number of processes each running a complete python interpret... | 4 | 4 | 0 | I have a python (well, it's php now but we're rewriting) function that takes some parameters (A and B) and compute some results (finds best path from A to B in a graph, graph is read-only), in typical scenario one call takes 0.1s to 0.9s to complete. This function is accessed by users as a simple REST web-service (GET ... | how to process long-running requests in python workers? | 0.028564 | 0 | 1 | 2,509 |
1,674,696 | 2009-11-04T15:51:00.000 | 0 | 1 | 0 | 1 | python,nginx,load-balancing,wsgi,reverse-proxy | 1,676,102 | 7 | false | 0 | 0 | You could use nginx load balancer to proxy to PythonPaste paster (which serves WSGI, for example Pylons), that launches each request as separate thread anyway. | 4 | 4 | 0 | I have a python (well, it's php now but we're rewriting) function that takes some parameters (A and B) and compute some results (finds best path from A to B in a graph, graph is read-only), in typical scenario one call takes 0.1s to 0.9s to complete. This function is accessed by users as a simple REST web-service (GET ... | how to process long-running requests in python workers? | 0 | 0 | 1 | 2,509 |
1,674,764 | 2009-11-04T15:58:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine,properties,runtime | 1,674,790 | 2 | true | 1 | 0 | You can:
edit records in the datastore through the dashboard ( if you really have to )
upload new scripts / files ( you can access files in READ-ONLY )
export a WEB Service API to configuration records in the datastore ( probably not what you had in mind )
access a page somewhere through an HTTP end-point | 1 | 0 | 0 | Coming from a java background I'm used to having a bunch of properties files I can swap round at runtime dependent on what server I'm running on e.g. dev/production.
Is there a method in python to do similar, specifically on Google's App Engine framework?
At the minute I have them defined in .py files, obviously I'd li... | Can I add Runtime Properties to a Python App Engine App? | 1.2 | 0 | 0 | 158 |
1,675,904 | 2009-11-04T19:01:00.000 | 1 | 1 | 0 | 0 | python,penetration-tools | 2,305,866 | 4 | false | 0 | 0 | well i think that c is more powerful than both languages, and is better for pen-testing. | 3 | 4 | 0 | I hear Python is very good for pentesting. It has got good modules for that. But it's not a good framework, like Metasploit. | Is Python or Ruby good for penetration testing? | 0.049958 | 0 | 0 | 7,782 |
1,675,904 | 2009-11-04T19:01:00.000 | 1 | 1 | 0 | 0 | python,penetration-tools | 19,335,182 | 4 | false | 0 | 0 | But C isn't a scriptng language there is many arguments that proof that python/ruby are better for pen testing . For example with C you can't automate so fast as with python/ruby , python/ruby is high-level language and writing programs on them are a lot easier than C . But if you want to deal with pen-testing you shou... | 3 | 4 | 0 | I hear Python is very good for pentesting. It has got good modules for that. But it's not a good framework, like Metasploit. | Is Python or Ruby good for penetration testing? | 0.049958 | 0 | 0 | 7,782 |
1,675,904 | 2009-11-04T19:01:00.000 | 4 | 1 | 0 | 0 | python,penetration-tools | 1,675,945 | 4 | true | 0 | 0 | Any language that has good, easy string handling capabilities is a good match for penetration testing. This is why you see scripting languages as the most used languages in this sort of tasks.
To answer your question, they're just as good. | 3 | 4 | 0 | I hear Python is very good for pentesting. It has got good modules for that. But it's not a good framework, like Metasploit. | Is Python or Ruby good for penetration testing? | 1.2 | 0 | 0 | 7,782 |
1,676,835 | 2009-11-04T21:42:00.000 | 16 | 1 | 1 | 0 | python,self-reference | 1,676,861 | 7 | false | 0 | 0 | If you have a class in that module, then the __module__ property of the class is the module name of the class. Thus you can access the module via sys.modules[klass.__module__]. This is also works for functions. | 2 | 187 | 0 | How can I get a reference to a module from within that module? Also, how can I get a reference to the package containing that module? | How to get a reference to a module inside the module itself? | 1 | 0 | 0 | 72,566 |
1,676,835 | 2009-11-04T21:42:00.000 | 0 | 1 | 1 | 0 | python,self-reference | 70,034,466 | 7 | false | 0 | 0 | If all you need is to get access to module variable then use globals()['bzz'] (or vars()['bzz'] if it's module level). | 2 | 187 | 0 | How can I get a reference to a module from within that module? Also, how can I get a reference to the package containing that module? | How to get a reference to a module inside the module itself? | 0 | 0 | 0 | 72,566 |
1,679,673 | 2009-11-05T10:35:00.000 | 1 | 1 | 1 | 0 | python,import,path,module | 1,679,860 | 4 | false | 0 | 0 | Your current working directory is first in the sys.path. Anything there trumps anything else on the path.
Copy the "test version" to some place closer to the front of the list of directories in sys.path, like your current working directory. | 1 | 1 | 0 | I have made some changes in a python module in my checked out copy of a repository, and need to test them. However, when I try to run a script that uses the module, it keeps importing the module from the trunk of the repository, which is of no use to me.
I tried setting PYTHONPATH, which did nothing at all. After some... | How do I make Python pick the correct module without manually modifying sys.path? | 0.049958 | 0 | 0 | 4,291 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.