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 the specific point release &c you're using) and therefore subtle, VERY hard-to-debug race conditions being introduced with any upgrade or port to other Python implementations.
If your profiling tells you that Queue's strong and general guarantees are being a bottleneck for your specific producer-consumer use case, make your own simpler guaranteed-to-be-threadsafe FIFO queue/stream. For example, if you've found out that (net of race conditions) append and pop would be perfect for your use, just make a class that protects each with a lock acquire/release (use a with statement) -- Queue adds miniscule overhead to support multiple producers and consumers and you can shave those few nanoseconds off!-) | 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 the processing function just .pop(0)? I'm not sure if the protections in Queue are meant for more complex "multi-producer, multi-consumer queues" and a waste for a point-to-point byte stream. Doing things like flushing the queue or grabbing multiple bytes seem more awkward with the Queue vs. a simpler data type.
I guess the answer might have to do with if .pop() is atomic, but would it even matter then?... | 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 the processing function just .pop(0)? I'm not sure if the protections in Queue are meant for more complex "multi-producer, multi-consumer queues" and a waste for a point-to-point byte stream. Doing things like flushing the queue or grabbing multiple bytes seem more awkward with the Queue vs. a simpler data type.
I guess the answer might have to do with if .pop() is atomic, but would it even matter then?... | 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 situation where you'd be at all undecided between Java and Python if the deployment was due to happen on some general purpose platform such as Linux, I think the maturity and completeness arguments could sway you towards Python for deployment on App Engine, and towards Java for deployment on Android. | 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, that directory can often be found at
/usr/local/lib/python2.6/dist-packages/ | 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 implemented in different languages).
I also read somewhere that Python is C++ interpretation. Is this correct? And what does that mean?
I'm still very new to Python, so forgive me if I ask the dumb questions...
Thank you so much! | 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 byte code, which is stored in the .pyc file. It then executes that code using a bytecode interpreter. This design separates the parsing of python from the execution, allowing both parts of the interpreter to be simpler.
Jython is only the front half -- it reads Python source, and outputs Java bytecodes, which are then interpreted by the JVM. It's the same architecture as CPython, with two noteworthy differences: One: the java bytecode is standardized and documented, while the CPython bytecode is considered internal to python, and can change at any time. Two: the JVM is a whole lot more complicated than the CPython interpreter. The JVM has one of the most advanced JIT engines in the world, while the CPython interpreter is pretty simple. | 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 implemented in different languages).
I also read somewhere that Python is C++ interpretation. Is this correct? And what does that mean?
I'm still very new to Python, so forgive me if I ask the dumb questions...
Thank you so much! | 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 compilation from .py to .pyc happens transparently as needed. When you execute a .py file, it will first be compiled to a .pyc file if needed, then the .pyc file will be interpreted.
Jython is different because (in addition to being implemented in Java instead of C) it compiles .py files into .class files so they can be executed in the JVM. | 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 implemented in different languages).
I also read somewhere that Python is C++ interpretation. Is this correct? And what does that mean?
I'm still very new to Python, so forgive me if I ask the dumb questions...
Thank you so much! | 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 do its best to fix it. | 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 to show it in the browser (with xslt stylsheet). This should be made by using included features of python. | 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 to show it in the browser (with xslt stylsheet). This should be made by using included features of python. | 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 by piping the output of the manage sql... commands to manage dbshell, but this relies on manage dbshelland is kind of hacky...
Are there any other ways to do this?
Edit:
manage reset will do it, but is there a command like reset that doesn't need the application names as parameters? | 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 source or anything like that.
The Python version must have ncurses or curses support (I'm making a form handler).
I've found two different precompiled versions of Python for AIX, but one (2.1.something) didn't include the curses module, and the other (2.3.4, RPM format) had prerequisites that I failed to fulfill).
Any help would be greatly appreciated. | 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 will contain the certificate(s) in an encrypted structure, but all compliant parsers should be able to read it from an unencrypted structure. Also, PKCS#12-files will usually contain a MacData-structure for integrity-check, but this is optional and a compliant parser should work fine without it. | 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 point me in the right direction? If it helps, the reason I need them in PKCS12 format is so that I can import them on the iPhone, which seems to only allow key-import in that format. | 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 better use external (provided with your OS) rotation with server restart or setup single-process logging server. | 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().addHandler(handler)
and i use mod_python with apache2.
the problem is: when the log rotate, i got many log files created at the same time.
for example, i set 5 work-process in apache, and i got log.1, log.2 ... log.5 when it rotate.
any suggestions? | 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, because getheaders returns a LIST, not DICT, so I thought they wrote it with multiple headers of the same name). So, when I send this joined header back to client, it confuses client. How can I obtain full list of headers in httplib (without just splitting Set-Cookie header on commas)? | 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 OBJECT_MODE to 32, everything worked!!! | 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 ncurses (see below), which is why I've tried in multiple ways to point out to configure where to find libncurses.a. /usr/lib/libncurses.a is a symbolic link to /utv/sad/ncurses/lib/libncurses.a, which exists and has no permission problems. There is also a link to that file in /usr/local/lib.
My problem is that I get the following errors from make:
running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or headers
building '_curses' extension
./Modules/ld_so_aix gcc -bI:Modules/python.exp build/temp.aix-5.3-2.6/home/chenf/python-src/Python-2.6.4/Modules/_cursesmodule.o -L/usr/local/lib -lncurses -o build/lib.aix-5.3-2.6/_curses.so
ld: 0711-317 ERROR: Undefined symbol: _unctrl
ld: 0711-317 ERROR: Undefined symbol: .setsyx
ld: 0711-317 ERROR: Undefined symbol: ._setqiflush
ld: 0711-317 ERROR: Undefined symbol: .initscr32
ld: 0711-317 ERROR: Undefined symbol: wacs_map
ld: 0711-317 ERROR: Undefined symbol: ._getsyx
ld: 0711-317 ERROR: Undefined symbol: .getattrs
ld: 0711-317 ERROR: Undefined symbol: .w32attrset
ld: 0711-317 ERROR: Undefined symbol: .w32insch
ld: 0711-317 ERROR: Undefined symbol: .p32echochar
ld: 0711-317 ERROR: Undefined symbol: .w32echochar
ld: 0711-317 ERROR: Undefined symbol: .getcury
ld: 0711-317 ERROR: Undefined symbol: .getcurx
ld: 0711-317 ERROR: Undefined symbol: .box32
ld: 0711-317 ERROR: Undefined symbol: .w32attron
ld: 0711-317 ERROR: Undefined symbol: .w32attroff
ld: 0711-317 ERROR: Undefined symbol: .w32addch
ld: 0711-317 ERROR: Undefined symbol: .getpary
ld: 0711-317 ERROR: Undefined symbol: .getparx
ld: 0711-317 ERROR: Undefined symbol: .getmaxy
ld: 0711-317 ERROR: Undefined symbol: .getmaxx
ld: 0711-317 ERROR: Undefined symbol: .getbegy
ld: 0711-317 ERROR: Undefined symbol: .getbegx
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status
building 'zlib' extension
./Modules/ld_so_aix gcc -bI:Modules/python.exp build/temp.aix-5.3-2.6/home/chenf/python-src/Python-2.6.4/Modules/zlibmodule.o -L/usr/local/lib -lz -o build/lib.aix-5.3-2.6/zlib.so
ld: 0711-317 ERROR: Undefined symbol: .inflateCopy
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status
building 'bz2' extension
gcc -DNDEBUG -O -I. -I/home/chenf/python-src/Python-2.6.4/./Include -I. -IInclude -I./Include -I/usr/local/include -I/home/chenf/python-src/Python-2.6.4/Include -I/home/chenf/python-src/Python-2.6.4 -c /home/chenf/python-src/Python-2.6.4/Modules/bz2module.c -o build/temp.aix-5.3-2.6/home/chenf/python-src/Python-2.6.4/Modules/bz2module.o
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:12:19: bzlib.h: No such file or directory
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:111: error: parse error before "BZFILE"
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:111: warning: no semicolon at end of struct or union
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:118: error: parse error before '}' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:118: warning: data definition has no type or storage class
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:122: error: parse error before "bz_stream"
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:122: warning: no semicolon at end of struct or union
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:127: error: parse error before '}' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:127: warning: data definition has no type or storage class
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:131: error: parse error before "bz_stream"
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:131: warning: no semicolon at end of struct or union
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:137: error: parse error before '}' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:137: warning: data definition has no type or storage class
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `Util_CatchBZ2Error':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:147: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:147: error: (Each undeclared identifier is reported only once
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:147: error: for each function it appears in.)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:148: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:160: error: `BZ_PARAM_ERROR' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:167: error: `BZ_MEM_ERROR' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:172: error: `BZ_DATA_ERROR' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:173: error: `BZ_DATA_ERROR_MAGIC' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:178: error: `BZ_IO_ERROR' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:183: error: `BZ_UNEXPECTED_EOF' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:190: error: `BZ_SEQUENCE_ERROR' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:229: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `Util_GetLine':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:239: error: `f' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:243: error: `n' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:265: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:282: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:325: error: parse error before "BZFILE"
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `Util_UnivNewlineRead':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:328: error: `buf' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:334: error: `f' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:335: error: `bzerror' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:335: error: `stream' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:335: error: `n' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:380: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:392: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `Util_DropReadAhead':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:394: error: `f' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:402: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `Util_ReadAhead':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:407: error: `f' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:418: error: `bufsize' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:427: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:430: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:443: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `Util_ReadAheadGetLineSkip':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:450: error: `f' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:451: error: `bufsize' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:457: error: `skip' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:498: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_read':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:505: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:509: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:549: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:553: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:585: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_readline':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:590: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:594: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:630: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_readlines':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:647: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:651: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:677: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:685: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:792: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_write':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:800: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:806: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:828: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:852: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_writelines':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:863: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:878: error: `seq' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:953: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:990: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_seek':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1004: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1016: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1046: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1048: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1143: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_tell':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1147: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1172: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_close':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1175: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1178: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1204: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1225: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_get_newlines':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1227: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1254: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_get_closed':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1256: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1260: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_get_mode':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1262: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1266: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_get_name':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1268: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1291: error: parse error before ')' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1291: error: initializer element is not constant
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1291: error: (near initialization for `BZ2File_members[0].offset')
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1292: error: initializer element is not constant
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1292: error: (near initialization for `BZ2File_members[0]')
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1293: error: initializer element is not constant
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1293: error: (near initialization for `BZ2File_members[1]')
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1300: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_init':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1311: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1313: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1313: error: `kwargs' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1390: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1412: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_dealloc':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1419: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1440: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_getiter':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1442: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1454: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_iternext':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1458: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1554: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2Comp_compress':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1562: error: `bz_stream' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1562: error: `bzs' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1562: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1565: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1595: error: `BZ_RUN' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1597: error: `BZ_RUN_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1636: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2Comp_flush':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1640: error: `bz_stream' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1640: error: `bzs' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1640: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1663: error: `BZ_FINISH' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1665: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1667: error: `BZ_FINISH_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1707: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2Comp_init':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1713: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1713: error: `kwargs' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1731: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1731: error: `bz_stream' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1733: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1752: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2Comp_dealloc':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1758: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1826: error: parse error before ')' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1826: error: initializer element is not constant
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1826: error: (near initialization for `BZ2Decomp_members[0].offset')
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1826: error: initializer element is not constant
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1826: error: (near initialization for `BZ2Decomp_members[0]')
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1827: error: initializer element is not constant
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1827: error: (near initialization for `BZ2Decomp_members[1]')
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1845: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2Decomp_decompress':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1853: error: `bz_stream' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1853: error: `bzs' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1853: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1856: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1883: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1893: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1936: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2Decomp_init':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1940: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1951: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1955: error: `bz_stream' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1957: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1978: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2Decomp_dealloc':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1984: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `bz2_compress':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2065: error: `bz_stream' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2065: error: parse error before "_bzs"
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2066: error: `bzs' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2066: error: `_bzs' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2102: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2111: error: `BZ_FINISH' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2113: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2115: error: `BZ_FINISH_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `bz2_decompress':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2158: error: `bz_stream' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2158: error: parse error before "_bzs"
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2159: error: `bzs' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2159: error: `_bzs' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2186: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2197: error: `BZ_STREAM_END' undeclared (first use in this function)
building '_multiprocessing' extension
gcc -DNDEBUG -O -DHAVE_SEM_OPEN=1 -DHAVE_FD_TRANSFER=1 -DHAVE_SEM_TIMEDWAIT=1 -IModules/_multiprocessing -I. -I/home/chenf/python-src/Python-2.6.4/./Include -I. -IInclude -I./Include -I/usr/local/include -I/home/chenf/python-src/Python-2.6.4/Include -I/home/chenf/python-src/Python-2.6.4 -c /home/chenf/python-src/Python-2.6.4/Modules/_multiprocessing/socket_connection.c -o build/temp.aix-5.3-2.6/home/chenf/python-src/Python-2.6.4/Modules/_multiprocessing/socket_connection.o
In file included from /home/chenf/python-src/Python-2.6.4/Modules/_multiprocessing/socket_connection.c:202:
/home/chenf/python-src/Python-2.6.4/Modules/_multiprocessing/connection.h: In function `connection_poll':
/home/chenf/python-src/Python-2.6.4/Modules/_multiprocessing/connection.h:357: error: `_save' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/_multiprocessing/connection.h:357: error: (Each undeclared identifier is reported only once
/home/chenf/python-src/Python-2.6.4/Modules/_multiprocessing/connection.h:357: error: for each function it appears in.)
Traceback (most recent call last):
File "./setup.py", line 1910, in
main()
File "./setup.py", line 1905, in main
'Lib/smtpd.py']
File "/home/chenf/python-src/Python-2.6.4/Lib/distutils/core.py", line 152, in setup
dist.run_commands()
File "/home/chenf/python-src/Python-2.6.4/Lib/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/home/chenf/python-src/Python-2.6.4/Lib/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "/home/chenf/python-src/Python-2.6.4/Lib/distutils/command/build.py", line 134, in run
self.run_command(cmd_name)
File "/home/chenf/python-src/Python-2.6.4/Lib/distutils/cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "/home/chenf/python-src/Python-2.6.4/Lib/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "/home/chenf/python-src/Python-2.6.4/Lib/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "./setup.py", line 201, in build_extensions
build_ext.build_extensions(self)
File "/home/chenf/python-src/Python-2.6.4/Lib/distutils/command/build_ext.py", line 449, in build_extensions
self.build_extension(ext)
File "./setup.py", line 234, in build_extension
if not self.configure_ctypes(ext):
File "./setup.py", line 1715, in configure_ctypes
ffi_srcdir = os.path.join(fficonfig['ffi_srcdir'], 'src')
KeyError: 'ffi_srcdir'
make: 1254-004 The error code from the last command is 1.
Stop.
The thing about not being able to locate Tcl/Tk is not a problem, I don't need those.
However, curses, which is the following problem, IS a problem. I need that. If I interpret things correctly, it can't find libncurses.a. At least, all the listed "Undefined symbols" look like ncurses functions to me. But maybe I'm wrong, maybe it does find the libncurses.a file, but can't find the symbols in it? I don't know. | 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 to use.
Step two: Put a soft link for ncurses.h under /usr/include.
I couldn't get configure to find ncurses.h under /opt/utv/sad/include/ncurses/, so I cheated; I ran the following command as root:
ln -s /utv/sad/ncurses/include/ncurses/ncurses.h /usr/include/ncurses.h
Step three:
I compiled and installed GNU binutils and GNU make, configuring them with "--prefix=/home/chenf". Then I put /home/chenf/bin first in my path, to make sure the compilation process would use whatever it found there instead of the defaults provides by AIX.
Step four: I ran configure like this:
./configure --prefix=/opt/freeware --disable-ipv6 --without-threads --with-ncurses=/opt/sad/ncurses
Ipv6 and threads were giving me compilation errors, and I don't need them, so that's why I disabled them. Under the /opt/sad/ncurses directory, lib/libncurses.a is found. That seems to have taken care of the library itself.
After that, all I had to do was "make" and "make install". Done.
I did get some errors during compilation, and in the end I was told that it had failed to produce some of the modules (like math, and datetime) but that everything else was still OK. For the time being I'll make do without them. | 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 ncurses (see below), which is why I've tried in multiple ways to point out to configure where to find libncurses.a. /usr/lib/libncurses.a is a symbolic link to /utv/sad/ncurses/lib/libncurses.a, which exists and has no permission problems. There is also a link to that file in /usr/local/lib.
My problem is that I get the following errors from make:
running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or headers
building '_curses' extension
./Modules/ld_so_aix gcc -bI:Modules/python.exp build/temp.aix-5.3-2.6/home/chenf/python-src/Python-2.6.4/Modules/_cursesmodule.o -L/usr/local/lib -lncurses -o build/lib.aix-5.3-2.6/_curses.so
ld: 0711-317 ERROR: Undefined symbol: _unctrl
ld: 0711-317 ERROR: Undefined symbol: .setsyx
ld: 0711-317 ERROR: Undefined symbol: ._setqiflush
ld: 0711-317 ERROR: Undefined symbol: .initscr32
ld: 0711-317 ERROR: Undefined symbol: wacs_map
ld: 0711-317 ERROR: Undefined symbol: ._getsyx
ld: 0711-317 ERROR: Undefined symbol: .getattrs
ld: 0711-317 ERROR: Undefined symbol: .w32attrset
ld: 0711-317 ERROR: Undefined symbol: .w32insch
ld: 0711-317 ERROR: Undefined symbol: .p32echochar
ld: 0711-317 ERROR: Undefined symbol: .w32echochar
ld: 0711-317 ERROR: Undefined symbol: .getcury
ld: 0711-317 ERROR: Undefined symbol: .getcurx
ld: 0711-317 ERROR: Undefined symbol: .box32
ld: 0711-317 ERROR: Undefined symbol: .w32attron
ld: 0711-317 ERROR: Undefined symbol: .w32attroff
ld: 0711-317 ERROR: Undefined symbol: .w32addch
ld: 0711-317 ERROR: Undefined symbol: .getpary
ld: 0711-317 ERROR: Undefined symbol: .getparx
ld: 0711-317 ERROR: Undefined symbol: .getmaxy
ld: 0711-317 ERROR: Undefined symbol: .getmaxx
ld: 0711-317 ERROR: Undefined symbol: .getbegy
ld: 0711-317 ERROR: Undefined symbol: .getbegx
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status
building 'zlib' extension
./Modules/ld_so_aix gcc -bI:Modules/python.exp build/temp.aix-5.3-2.6/home/chenf/python-src/Python-2.6.4/Modules/zlibmodule.o -L/usr/local/lib -lz -o build/lib.aix-5.3-2.6/zlib.so
ld: 0711-317 ERROR: Undefined symbol: .inflateCopy
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status
building 'bz2' extension
gcc -DNDEBUG -O -I. -I/home/chenf/python-src/Python-2.6.4/./Include -I. -IInclude -I./Include -I/usr/local/include -I/home/chenf/python-src/Python-2.6.4/Include -I/home/chenf/python-src/Python-2.6.4 -c /home/chenf/python-src/Python-2.6.4/Modules/bz2module.c -o build/temp.aix-5.3-2.6/home/chenf/python-src/Python-2.6.4/Modules/bz2module.o
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:12:19: bzlib.h: No such file or directory
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:111: error: parse error before "BZFILE"
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:111: warning: no semicolon at end of struct or union
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:118: error: parse error before '}' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:118: warning: data definition has no type or storage class
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:122: error: parse error before "bz_stream"
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:122: warning: no semicolon at end of struct or union
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:127: error: parse error before '}' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:127: warning: data definition has no type or storage class
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:131: error: parse error before "bz_stream"
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:131: warning: no semicolon at end of struct or union
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:137: error: parse error before '}' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:137: warning: data definition has no type or storage class
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `Util_CatchBZ2Error':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:147: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:147: error: (Each undeclared identifier is reported only once
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:147: error: for each function it appears in.)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:148: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:160: error: `BZ_PARAM_ERROR' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:167: error: `BZ_MEM_ERROR' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:172: error: `BZ_DATA_ERROR' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:173: error: `BZ_DATA_ERROR_MAGIC' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:178: error: `BZ_IO_ERROR' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:183: error: `BZ_UNEXPECTED_EOF' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:190: error: `BZ_SEQUENCE_ERROR' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:229: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `Util_GetLine':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:239: error: `f' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:243: error: `n' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:265: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:282: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:325: error: parse error before "BZFILE"
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `Util_UnivNewlineRead':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:328: error: `buf' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:334: error: `f' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:335: error: `bzerror' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:335: error: `stream' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:335: error: `n' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:380: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:392: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `Util_DropReadAhead':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:394: error: `f' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:402: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `Util_ReadAhead':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:407: error: `f' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:418: error: `bufsize' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:427: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:430: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:443: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `Util_ReadAheadGetLineSkip':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:450: error: `f' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:451: error: `bufsize' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:457: error: `skip' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:498: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_read':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:505: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:509: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:549: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:553: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:585: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_readline':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:590: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:594: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:630: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_readlines':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:647: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:651: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:677: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:685: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:792: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_write':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:800: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:806: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:828: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:852: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_writelines':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:863: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:878: error: `seq' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:953: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:990: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_seek':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1004: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1016: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1046: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1048: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1143: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_tell':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1147: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1172: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_close':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1175: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1178: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1204: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1225: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_get_newlines':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1227: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1254: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_get_closed':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1256: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1260: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_get_mode':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1262: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1266: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_get_name':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1268: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1291: error: parse error before ')' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1291: error: initializer element is not constant
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1291: error: (near initialization for `BZ2File_members[0].offset')
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1292: error: initializer element is not constant
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1292: error: (near initialization for `BZ2File_members[0]')
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1293: error: initializer element is not constant
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1293: error: (near initialization for `BZ2File_members[1]')
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1300: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_init':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1311: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1313: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1313: error: `kwargs' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1390: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1412: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_dealloc':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1419: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1440: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_getiter':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1442: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1454: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2File_iternext':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1458: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1554: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2Comp_compress':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1562: error: `bz_stream' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1562: error: `bzs' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1562: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1565: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1595: error: `BZ_RUN' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1597: error: `BZ_RUN_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1636: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2Comp_flush':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1640: error: `bz_stream' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1640: error: `bzs' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1640: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1663: error: `BZ_FINISH' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1665: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1667: error: `BZ_FINISH_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1707: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2Comp_init':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1713: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1713: error: `kwargs' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1731: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1731: error: `bz_stream' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1733: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1752: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2Comp_dealloc':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1758: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1826: error: parse error before ')' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1826: error: initializer element is not constant
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1826: error: (near initialization for `BZ2Decomp_members[0].offset')
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1826: error: initializer element is not constant
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1826: error: (near initialization for `BZ2Decomp_members[0]')
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1827: error: initializer element is not constant
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1827: error: (near initialization for `BZ2Decomp_members[1]')
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1845: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2Decomp_decompress':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1853: error: `bz_stream' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1853: error: `bzs' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1853: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1856: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1883: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1893: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1936: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2Decomp_init':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1940: error: `args' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1951: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1955: error: `bz_stream' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1957: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: At top level:
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1978: error: parse error before '*' token
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `BZ2Decomp_dealloc':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:1984: error: `self' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `bz2_compress':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2065: error: `bz_stream' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2065: error: parse error before "_bzs"
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2066: error: `bzs' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2066: error: `_bzs' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2102: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2111: error: `BZ_FINISH' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2113: error: `BZ_STREAM_END' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2115: error: `BZ_FINISH_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c: In function `bz2_decompress':
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2158: error: `bz_stream' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2158: error: parse error before "_bzs"
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2159: error: `bzs' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2159: error: `_bzs' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2186: error: `BZ_OK' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/bz2module.c:2197: error: `BZ_STREAM_END' undeclared (first use in this function)
building '_multiprocessing' extension
gcc -DNDEBUG -O -DHAVE_SEM_OPEN=1 -DHAVE_FD_TRANSFER=1 -DHAVE_SEM_TIMEDWAIT=1 -IModules/_multiprocessing -I. -I/home/chenf/python-src/Python-2.6.4/./Include -I. -IInclude -I./Include -I/usr/local/include -I/home/chenf/python-src/Python-2.6.4/Include -I/home/chenf/python-src/Python-2.6.4 -c /home/chenf/python-src/Python-2.6.4/Modules/_multiprocessing/socket_connection.c -o build/temp.aix-5.3-2.6/home/chenf/python-src/Python-2.6.4/Modules/_multiprocessing/socket_connection.o
In file included from /home/chenf/python-src/Python-2.6.4/Modules/_multiprocessing/socket_connection.c:202:
/home/chenf/python-src/Python-2.6.4/Modules/_multiprocessing/connection.h: In function `connection_poll':
/home/chenf/python-src/Python-2.6.4/Modules/_multiprocessing/connection.h:357: error: `_save' undeclared (first use in this function)
/home/chenf/python-src/Python-2.6.4/Modules/_multiprocessing/connection.h:357: error: (Each undeclared identifier is reported only once
/home/chenf/python-src/Python-2.6.4/Modules/_multiprocessing/connection.h:357: error: for each function it appears in.)
Traceback (most recent call last):
File "./setup.py", line 1910, in
main()
File "./setup.py", line 1905, in main
'Lib/smtpd.py']
File "/home/chenf/python-src/Python-2.6.4/Lib/distutils/core.py", line 152, in setup
dist.run_commands()
File "/home/chenf/python-src/Python-2.6.4/Lib/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/home/chenf/python-src/Python-2.6.4/Lib/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "/home/chenf/python-src/Python-2.6.4/Lib/distutils/command/build.py", line 134, in run
self.run_command(cmd_name)
File "/home/chenf/python-src/Python-2.6.4/Lib/distutils/cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "/home/chenf/python-src/Python-2.6.4/Lib/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "/home/chenf/python-src/Python-2.6.4/Lib/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "./setup.py", line 201, in build_extensions
build_ext.build_extensions(self)
File "/home/chenf/python-src/Python-2.6.4/Lib/distutils/command/build_ext.py", line 449, in build_extensions
self.build_extension(ext)
File "./setup.py", line 234, in build_extension
if not self.configure_ctypes(ext):
File "./setup.py", line 1715, in configure_ctypes
ffi_srcdir = os.path.join(fficonfig['ffi_srcdir'], 'src')
KeyError: 'ffi_srcdir'
make: 1254-004 The error code from the last command is 1.
Stop.
The thing about not being able to locate Tcl/Tk is not a problem, I don't need those.
However, curses, which is the following problem, IS a problem. I need that. If I interpret things correctly, it can't find libncurses.a. At least, all the listed "Undefined symbols" look like ncurses functions to me. But maybe I'm wrong, maybe it does find the libncurses.a file, but can't find the symbols in it? I don't know. | 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 the INSERT is being executed without transactions. Whether or not that happens implicitly depends on the Jet version and the data interface library you're using to accomplish the task. By explicitly making sure it's off, you could improve the situation.
Another possibility is to drop the indexes before the insert, compact, run the insert, compact, re-instate the indexes, and run a final compact. | 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 inserts into chunks and compacting inbetween each, are there any techniques for avoiding the increase in file size?
Note that no temporary tables are being created/deleted during the process: just inserts into existing tables.
And to forstall the inevitable comments: yes, I am required to store this data in Access 2003. No, I can't upgrade to Access 2007.
If it could help, I could preprocess in sqlite.
Edit:
Just to add some further information (some already listed in my comments):
The data is being generated in Python on a table by table basis, and then all of the records for that table batch inserted via odbc
All processing is happening in Python: all the mdb file is doing is storing the data
All of the fields being inserted are valid fields (none are being excluded due to unique key violations, etc.)
Given the above, I'll be looking into how to disable row level locking via odbc and considering presorting the data and/or removing then reinstating indexes. Thanks for the suggestions.
Any further suggestions still welcome. | 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 inserts into chunks and compacting inbetween each, are there any techniques for avoiding the increase in file size?
Note that no temporary tables are being created/deleted during the process: just inserts into existing tables.
And to forstall the inevitable comments: yes, I am required to store this data in Access 2003. No, I can't upgrade to Access 2007.
If it could help, I could preprocess in sqlite.
Edit:
Just to add some further information (some already listed in my comments):
The data is being generated in Python on a table by table basis, and then all of the records for that table batch inserted via odbc
All processing is happening in Python: all the mdb file is doing is storing the data
All of the fields being inserted are valid fields (none are being excluded due to unique key violations, etc.)
Given the above, I'll be looking into how to disable row level locking via odbc and considering presorting the data and/or removing then reinstating indexes. Thanks for the suggestions.
Any further suggestions still welcome. | 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 index(es)), number of indexes (as you mentioned readily dropping some during the insert phase)...
Tentatively a pre-processing approach with say storing of new rows to a separate linked table, heap fashion (no indexes), then sorting/indexing this data is a minimal fashion, and "bulk loading" it to its real destination. Similar pre-processing in SQLite (has hinted in question) would serve the serve purpose. Keeping it "ALL MDB" is maybe easier (fewer languages/processes to learn, fewer inter-op issues [hopefuly ;-)]...)
EDIT: on why inserting records in a sorted/bulk fashion may slow down the MDB file's growth (question from Tony Toews)
One of the reasons for MDB files' propensity to grow more quickly than the rate at which text/data added to them (and their counterpart ability to be easily compacted back down) is that as information is added, some of the nodes that constitute the indexes have to be re-arranged (for overflowing / rebalancing etc.). Such management of the nodes seems to be implemented in a fashion which favors speed over disk space and harmony, and this approach typically serves simple applications / small data rather well. I do not know the specific logic in use for such management but I suspect that in several cases, node operations cause a particular node (or much of it) to be copied anew, and the old location simply being marked as free/unused but not deleted/compacted/reused. I do have "clinical" (if only a bit outdated) evidence that by performing inserts in bulk we essentially limit the number of opportunities for such duplication to occur and hence we slow the growth.
EDIT again: After reading and discussing things from Tony Toews and Albert Kallal it appears that a possibly more significant source of bloat, in particular in Jet Engine 4.0, is the way locking is implemented. It is therefore important to set the database in single user mode to avoid this. (Read Tony's and Albert's response for more details. | 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 inserts into chunks and compacting inbetween each, are there any techniques for avoiding the increase in file size?
Note that no temporary tables are being created/deleted during the process: just inserts into existing tables.
And to forstall the inevitable comments: yes, I am required to store this data in Access 2003. No, I can't upgrade to Access 2007.
If it could help, I could preprocess in sqlite.
Edit:
Just to add some further information (some already listed in my comments):
The data is being generated in Python on a table by table basis, and then all of the records for that table batch inserted via odbc
All processing is happening in Python: all the mdb file is doing is storing the data
All of the fields being inserted are valid fields (none are being excluded due to unique key violations, etc.)
Given the above, I'll be looking into how to disable row level locking via odbc and considering presorting the data and/or removing then reinstating indexes. Thanks for the suggestions.
Any further suggestions still welcome. | 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 exclusive access to the database file. Which might be impossible if doing this during the day. I noticed a change in behavior from Jet 3.51 (used in Access 97) to Jet 4.0 (used in Access 2000) when the Access MDBs started getting a lot larger when doing record appends. I think that if the MDB is being used by multiple folks then records are inserted once per 4k page rather than as many as can be stuffed into a page. Likely because this made index insert/update operations faster.
Now compacting does indeed put as many records in the same 4k page as possible but that isn't of help to you. | 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 inserts into chunks and compacting inbetween each, are there any techniques for avoiding the increase in file size?
Note that no temporary tables are being created/deleted during the process: just inserts into existing tables.
And to forstall the inevitable comments: yes, I am required to store this data in Access 2003. No, I can't upgrade to Access 2007.
If it could help, I could preprocess in sqlite.
Edit:
Just to add some further information (some already listed in my comments):
The data is being generated in Python on a table by table basis, and then all of the records for that table batch inserted via odbc
All processing is happening in Python: all the mdb file is doing is storing the data
All of the fields being inserted are valid fields (none are being excluded due to unique key violations, etc.)
Given the above, I'll be looking into how to disable row level locking via odbc and considering presorting the data and/or removing then reinstating indexes. Thanks for the suggestions.
Any further suggestions still welcome. | 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 just not acceptable.
I could make a cron job that automatically runs the indexer command every so often, but that's far from optimal. New data won't be indexed until the cron runs again. In addition, the indexer will run unnecessarily most times as my site doesn't have data being added very often.
How do I set it up so that the Sphinx index will automatically rebuild itself whenever data is added to or modified in a searchable django model? | 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 you may run into when building with py2app on 10.5 + 2.6 + PyObjC 2.2 (which for a lot of reasons is what you should probably do, instead of using the Xcode templates from 10.5 that build differently), especially if you still have Python 2.5 installed somewhere, so you'll probably want to build and install py2app from trunk as well, this particular issue I ran into with PyObjC 2.2 on 2.6 on 10.5 has been fixed by now. | 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 wxPython but I have read that it's support on Mac OS X is fairly limited
Java sounds good & it looks good but it seems almost too difficult to program in
Any help? | 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 wxPython but I have read that it's support on Mac OS X is fairly limited
Java sounds good & it looks good but it seems almost too difficult to program in
Any help? | 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, which can be an advanatage or disadvantage based on your requirements.
Other good option is PyQT which will give you consistent look on all platforms. | 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 wxPython but I have read that it's support on Mac OS X is fairly limited
Java sounds good & it looks good but it seems almost too difficult to program in
Any help? | 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 wxPython but I have read that it's support on Mac OS X is fairly limited
Java sounds good & it looks good but it seems almost too difficult to program in
Any help? | 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 Prism with Mono.
All are quite mature and yet expanding at a great rate. For instance, Revolution is just introducing a web-application feature to its language that is really easy to use. | 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 wxPython but I have read that it's support on Mac OS X is fairly limited
Java sounds good & it looks good but it seems almost too difficult to program in
Any help? | 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 paradigm - the managers are different but not so different you'll have trouble switching.
Java has an absolute huge class library to the point where you probably don't need to write your own version of anything, just string together the components. I never really got that deep into Python but it may well be similar. One thing I did notice is that all the really good stuff I used in Python (e.g., s[-4:-1]) could still be done quite easily in Java. Both languages were a step up from C where I had to manage strings with my own libraries.
If you think wxPython is limited on MacOS, you should try Java. I run my Java code on Windows, Linux and other UNIXes without compatibility problems. Sadly, not Mac, so I can't really advise you there.
My advice, pick a smallish project - do it in both Python and Java - see how it runs on all the platforms you're interested in. | 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 wxPython but I have read that it's support on Mac OS X is fairly limited
Java sounds good & it looks good but it seems almost too difficult to program in
Any help? | 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 point releases as they are explicitly intended to be backward compatible. A bigger change is between Python 2.x and 3.0 for which some special-purpose tools including the -3 interpreter invocation option which shows the Python 3.0 related deprecation warnings. | 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 write code that pushes item after item on a stack, then invoke an operator that does something with the data you've accumulated. And it just so happens that a pickle has to end with the command ".", which says: "take the item now at the bottom of the stack and return it as the value of this pickle." If your pickle is chopped off early, it will not end with this command, and you will get an EOF error.
If you want to try recovering some of the data, you might have to write your own interpreter, or call into pickle.py somewhere that gets around its wanting to raise EOFError when done interpreting the stack without finding a ".". The main thing to keep in mind is that, as in most stack-based languages, big data structures are built "backwards": first you put lots of little strings or numbers on the stack, then you invoke an operation that says "put those together into a list" or "grab pairs of items on the stack and make a dictionary". So, if a pickle is interrupted, you'll find the stack full of pieces of the object that was going to be built, but you'll be missing that final code that tells you what was going to be built from the pieces. | 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 effects on the unpickler, would be very difficult to summarize in a simple statement like "it will always lead to an exception". | 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 header.
Pickle a tail object that you don't actually care about, but which simply matches the claim made in the header. This can be simply a string that matches what was in the header.
When you unpickle this file, you have to unpickle three things:
The header. You care about the count and the form of the tail.
The objects you actually care about.
The tail object. Check that it matches the header. Other than that, it doesn't convey much except that the file was written in it's entirety. | 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 some dud rubbish left over after an exception? | 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 / 1024)
Resident memory: 136 KB
>>> print "Virtual memory: %s KB" %(vms / 1024)
Virtual memory: 356 KB
>>> print proc.get_memory_percent()
0.00324324118077
Monitor the cpu load of the processes I spawn?
>>> proc.get_cpu_percent()
0.0
Kill processes I've spawned if they're taking too long or taking too much cpu?
>>> proc.kill()
>>> | 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, load average or equivalent of vmstat) in python?
Monitor the cpu load of the processes I spawn?
Kill processes I've spawned if they're taking too long or taking too much cpu?
Basically I need to be able to control the load the I'm placing on my server with my spawned threads.
Hopefully there's a package or library that'll do all this for me? | 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 tool's output. | 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 ok too. | 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 less work at read time. | 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 how else you might proceed. | 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 "fast enough."
It's only when you start having multiple simultaneous connections where you should look at Twisted or multithreading. | 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 support (don't re-invent the wheel all the time), existing tool support, existing integration support (if X supports Y, is it real feasible to get X to support Z just to use Z?), and most important to a subjective question: personal choice and zealot fanaticism :)
The term "scripting language" is absolutely horrid -- unless perhaps you really DO mean SH or MIRC "script". The phrase "dynamically typed language" is a much better qualifier. | 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 language, not particularly in either camp (but also not unsuitable), probably most useful for writing small or medium sized programs. | 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 from adding numbers to system calls to reading various different types of files. Hell, you can even do web programming with it.
I see no reason why I would advise against python... ever. | 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 lines, I probably want the minimalist simplicity of Lua (I may not like programming in Lua all that much, but 2-3 lines is indeed "scripting" more than "programming", and the near-zero cost of embedding Lua in anything will then dominate).
Python, like Perl or Ruby, is mostly used to write MUCH more substantial "scripts" (impossible to distinguish from "programs", except maybe by total bigots;-) -- in which case, very different considerations apply wrt "real" scripting languages such as bash or zsh, or lua or tcl for a different definition of "scripting language". Basically, if what you want is a dynamically (but strongly) typed language, with full capacity to scale up to very large software systems, and yet quite good at "playing with others"... then you surely have a particularly weird definition of "scripting", my friend!-) But that's the arena where Python, Ruby and Perl mostly play -- and where one could debate one against the other (but any one of them would crush any other popular language I know -- yeah, I've known and loved and used rexx, scheme, Smalltalk, and many many others, but none could hold a candle to the Big Three I just mentioned in this arena!-).
But unless you clarify your terminology, "scripting language" remains an empty, meaning-free sound, and any debate surrounding it utterly useless and void of significance. | 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 don't have to be a "programmer" to use it | 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 you to declare the type of each of the input variables. In python, as long as you pass input variables that work with the function, it's valid. This makes your code extremely flexible. You don't waste time declaring variables as one type or another, you just use them.
Some people will tell you that java produces code that is "more correct", but in animation and graphics, producing code that works in as short a time as possible is usually the goal. | 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 objects work correctly. You don't need Corba for this. | 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 not made myself clear enough, so I'll try to give a somewhat more concrete example:
A web application needs to display a page containing data received from the server. It obtains the data by calling server_pagetable.getData() and then formats the data, converts them to the correct python types (because Corba does not have e.g. a date type etc.) and finally creates the HTML code to be displayed.
And this is what I would like to test - the methods that receive the data and do all the transformations and finally create the HTML code.
I believe the most straightforward decision is to mock the Corba objects as they essentially comprise both the networking and db functionality (which ought not to be tested in unit tests).
It's just that this is quite a lot of "extra work" to do - mocking all the Corba objects (there is a User object, a server session object, the pagetable object, an admin object etc.). Maybe it's just because I'm stuck with Corba and therefore I have to reflect the object hierarchy dictated by the server with mocks. On the other hand, it could be that there is some cool elegant solution to testing code using Corba that just did not cross my mind. | 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 play the role of all three servers. | 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 not made myself clear enough, so I'll try to give a somewhat more concrete example:
A web application needs to display a page containing data received from the server. It obtains the data by calling server_pagetable.getData() and then formats the data, converts them to the correct python types (because Corba does not have e.g. a date type etc.) and finally creates the HTML code to be displayed.
And this is what I would like to test - the methods that receive the data and do all the transformations and finally create the HTML code.
I believe the most straightforward decision is to mock the Corba objects as they essentially comprise both the networking and db functionality (which ought not to be tested in unit tests).
It's just that this is quite a lot of "extra work" to do - mocking all the Corba objects (there is a User object, a server session object, the pagetable object, an admin object etc.). Maybe it's just because I'm stuck with Corba and therefore I have to reflect the object hierarchy dictated by the server with mocks. On the other hand, it could be that there is some cool elegant solution to testing code using Corba that just did not cross my mind. | 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 too many questions). In the end of the day, unittest is integration on a smaller scale so whenever I write tests I am always thinking of input and outputs rather than actual structures. From the way you have written your problem my concentration would be on the data of server_pagetable.getData() and the output HTML without caring too much about what happens inbetween (because that is the code you are testing, you don't want to define the code in the test but ensure that output is correct). If you want to test individual functions inbetween then I would get mock data (essentially still data, so you can generate mock data rather than mock class if possible). Mocks are only used when you don't have parts of the full code and those functions needs some input from those parts of the code but as you are not interested in them or don't have them you simplify the interaction with them. This is just my opinion. | 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 not made myself clear enough, so I'll try to give a somewhat more concrete example:
A web application needs to display a page containing data received from the server. It obtains the data by calling server_pagetable.getData() and then formats the data, converts them to the correct python types (because Corba does not have e.g. a date type etc.) and finally creates the HTML code to be displayed.
And this is what I would like to test - the methods that receive the data and do all the transformations and finally create the HTML code.
I believe the most straightforward decision is to mock the Corba objects as they essentially comprise both the networking and db functionality (which ought not to be tested in unit tests).
It's just that this is quite a lot of "extra work" to do - mocking all the Corba objects (there is a User object, a server session object, the pagetable object, an admin object etc.). Maybe it's just because I'm stuck with Corba and therefore I have to reflect the object hierarchy dictated by the server with mocks. On the other hand, it could be that there is some cool elegant solution to testing code using Corba that just did not cross my mind. | 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 after calling the function. | 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 models can talk to your data sources directly (files, databases), or proxy your own PyQt-agnostic models which were written before.
Views, which are implemented in Qt library, and often do not require any modifications (examples: QTreeView, QTableView and others). Even some simpler controls, like QComboBox can act as a view for a PyQt model.
All other parts of you application, which react to signals, etc. may be considered as "Controller".
PyQt also provides a set of predefined "universal" models which can be subclassed or used directly if you need only simple functionality from the model, like QStringListModel, QStandardItemModel, etc. And there are also models which can talk to databases directly, like QSqlTableModel. | 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 scheme is recommended for use in PyQt development? | 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, was that I wanted to work with my underlying data in Python (and numpy) and not R. I think this is the big question to ask, in which language do you want to load, parse and manipulate your data?
On the other hand, a bonus for R is that the plotting defaults just work (there's a function for everything). I find myself frequently digging through the matplotlib docs (they are thick) looking for some obscure way to adjust a border or increase a line thickness. R's plotting routines have some maturity behind them. | 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 equivalent figure (I also program regularly in Matlab) seems to be manageable in file size and also 'smoothed' - does matplotlib also provide such reductions...? But more generally, I wonder what other advantages matplotlib might confer. I don't mean this to be a trolling question. Thanks. | 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 overall richer language than R, with far more libraries that can help for various tasks. You have to access data for plotting, and data comes in many forms. In whatever form it comes I'm sure Python has an efficient library for it.
And how about embedding those plots in more complete programs, say simple GUIs? matplotlib binds easily with Python's GUI libs (like PyQT) and you can make stuff that only your imagination limits. | 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 equivalent figure (I also program regularly in Matlab) seems to be manageable in file size and also 'smoothed' - does matplotlib also provide such reductions...? But more generally, I wonder what other advantages matplotlib might confer. I don't mean this to be a trolling question. Thanks. | 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 chat80
print chat80.items
However, 'from nltk.tokenizer import *' returns 'File "stdin", line1.
I get similar errors when using any sort of "TOKEN=" or I'm guessing tokenization of anything.
I've installed python many times in the last few days, hoping a different version or better install might help.
I'm getting this error on windows7 using activePython2.6, though I've gotten similar err
ors with python 3.1 activePython3.1 and Python 2.6.
as well as on Mac OSx 10.5 with Python 2.5.
The mac is giving a bit more data with "Import Error: No module named tokenizer.
I'm just trying some of the introductory demos to nltk online, not even trying to write my own code yet, and I'm getting more errors than successes. | 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 slightly slower library. | 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 choosing one over the other is mainly up to the user. The setup.py is identical. | 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 understand it's not part of the standard library, so how can you assume the person who wants to install your program will have it installed? | 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 understand it's not part of the standard library, so how can you assume the person who wants to install your program will have it installed? | 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 programmers the setuptools would be fine.
Somehow, it also depends on how you want to distribute updates, and how often. For example, do the users have an access to the Internet without a nasty proxy setup by their company that would block setuptools? - We do have one and it's an extra step to configure and make it work on every workstation. | 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 understand it's not part of the standard library, so how can you assume the person who wants to install your program will have it installed? | 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 understand it's not part of the standard library, so how can you assume the person who wants to install your program will have it installed? | 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 understand it's not part of the standard library, so how can you assume the person who wants to install your program will have it installed? | 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 thought it would just be a nice, easy os.mount(). | 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 thought it would just be a nice, easy os.mount(). | 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 thought it would just be a nice, easy os.mount(). | 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 thought it would just be a nice, easy os.mount(). | 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 about implementing this?
Should a start a new thread for each callback function? As maybe some callbacks will take some time to return and I will timeout.
Also,
If the main loop where I read from the server is in a thread can I write to the socket from another thread(send messages to the server)?
Or is there a better approach?
Thanks. | 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 scrolls off the screen.
Now most people would react by trying python -h |less but that only works if you send the output of -h to the stdout instead of stderr. So there was a good reason for making -h go to stdout, but no good reason for changing -V. | 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]").
As a final note, I really need a regexp as it is part of a greater regexp.
Underscores should not be matched.
EDIT:
I hadn't thought about underscores state, so thanks for warnings about this being matched by "\w" and for the elected solution that addresses this issue. | 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 bestpath.php?from=A&to=B). Current implementation is quite stupid - it's a simple php script+apache+mod_php+APC, every requests needs to load all the data (over 12MB in php arrays), create all structures, compute a path and exit. I want to change it.
I want a setup with N independent workers (X per server with Y servers), each worker is a python app running in a loop (getting request -> processing -> sending reply -> getting req...), each worker can process one request at a time. I need something that will act as a frontend: get requests from users, manage queue of requests (with configurable timeout) and feed my workers with one request at a time.
how to approach this? can you propose some setup? nginx + fcgi or wsgi or something else? haproxy? as you can see i'am a newbie in python, reverse-proxy, etc. i just need a starting point about architecture (and data flow)
btw. workers are using read-only data so there is no need to maintain locking and communication between them | 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 loaded once per process and get reused for each new access. In fact I'm not sure this isn't the default configuration
for modwsgi/Apache.
The main problem here is that you might end up consuming
a lot of "core" memory (but that may not be a problem either).
I think you can also configure modwsgi for single process/multiple
thread -- but in that case you may only be using one CPU because
of the Python Global Interpreter Lock (the infamous GIL), I think.
Don't be afraid to ask at the modwsgi mailing list -- they are very
responsive and friendly. | 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 bestpath.php?from=A&to=B). Current implementation is quite stupid - it's a simple php script+apache+mod_php+APC, every requests needs to load all the data (over 12MB in php arrays), create all structures, compute a path and exit. I want to change it.
I want a setup with N independent workers (X per server with Y servers), each worker is a python app running in a loop (getting request -> processing -> sending reply -> getting req...), each worker can process one request at a time. I need something that will act as a frontend: get requests from users, manage queue of requests (with configurable timeout) and feed my workers with one request at a time.
how to approach this? can you propose some setup? nginx + fcgi or wsgi or something else? haproxy? as you can see i'am a newbie in python, reverse-proxy, etc. i just need a starting point about architecture (and data flow)
btw. workers are using read-only data so there is no need to maintain locking and communication between them | 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 interpreter and loading all your data into memory.
HTTP request comes in and gets dispatched off to some process
Process does your calculation and returns the result directly to the webserver and user
When you need to change your code or the graph data, you restart the webserver and go back to step 1.
This is the architecture used Django and other popular web frameworks. | 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 bestpath.php?from=A&to=B). Current implementation is quite stupid - it's a simple php script+apache+mod_php+APC, every requests needs to load all the data (over 12MB in php arrays), create all structures, compute a path and exit. I want to change it.
I want a setup with N independent workers (X per server with Y servers), each worker is a python app running in a loop (getting request -> processing -> sending reply -> getting req...), each worker can process one request at a time. I need something that will act as a frontend: get requests from users, manage queue of requests (with configurable timeout) and feed my workers with one request at a time.
how to approach this? can you propose some setup? nginx + fcgi or wsgi or something else? haproxy? as you can see i'am a newbie in python, reverse-proxy, etc. i just need a starting point about architecture (and data flow)
btw. workers are using read-only data so there is no need to maintain locking and communication between them | 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 bestpath.php?from=A&to=B). Current implementation is quite stupid - it's a simple php script+apache+mod_php+APC, every requests needs to load all the data (over 12MB in php arrays), create all structures, compute a path and exit. I want to change it.
I want a setup with N independent workers (X per server with Y servers), each worker is a python app running in a loop (getting request -> processing -> sending reply -> getting req...), each worker can process one request at a time. I need something that will act as a frontend: get requests from users, manage queue of requests (with configurable timeout) and feed my workers with one request at a time.
how to approach this? can you propose some setup? nginx + fcgi or wsgi or something else? haproxy? as you can see i'am a newbie in python, reverse-proxy, etc. i just need a starting point about architecture (and data flow)
btw. workers are using read-only data so there is no need to maintain locking and communication between them | 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 like a better separation. | 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 should learn Python or any other scripting language and C/C++ or other languages like PHP depent what are you testing but you should know a least one scripting language they make things a lot easier some times . | 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 searching around, I found that anything in the .pth files under site-packages directory will be put in even before PYTHONPATH (which to me defeats the purpose of having it). I believe this is the cause for my module not being picked.
Am I correct? If so, what is the way to override this (without modifying the script to have a sys.path.insert(0,path) )?
Edit: In reply to NicDumz - the original repository was under /projects/spam. The python modules were part of this in /projects/spam/sources/python/a/b/. However, these are 'built' every night using a homegrown make variant which then puts them into /projects/spam/build/lib/python/a/b/. The script is using the module under this last path only.
I have checked out the entire repository to under /home/sundar/spam, and made changes in /home/sundar/spam/sources/python/a/b/mymodule.py. I've set my PYTHONPATH to /home/sundar/spam/sources/python and tried to import a.b.mymodule with no success. | 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.