Title
stringlengths 15
150
| A_Id
int64 2.98k
72.4M
| Users Score
int64 -17
470
| Q_Score
int64 0
5.69k
| ViewCount
int64 18
4.06M
| Database and SQL
int64 0
1
| Tags
stringlengths 6
105
| Answer
stringlengths 11
6.38k
| GUI and Desktop Applications
int64 0
1
| System Administration and DevOps
int64 1
1
| Networking and APIs
int64 0
1
| Other
int64 0
1
| CreationDate
stringlengths 23
23
| AnswerCount
int64 1
64
| Score
float64 -1
1.2
| is_accepted
bool 2
classes | Q_Id
int64 1.85k
44.1M
| Python Basics and Environment
int64 0
1
| Data Science and Machine Learning
int64 0
1
| Web Development
int64 0
1
| Available Count
int64 1
17
| Question
stringlengths 41
29k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
appengine and no-ip.org | 1,480,797 | 1 | 0 | 875 | 0 | python,google-app-engine,dns,subdomain | You can't do this, because you don't own no-ip.org. In order to use a domain with App Engine, you have to set up Google Apps on the domain, and in order to do that, you must own the domain.
As mentioned in the comments, buying your own domain is your best option. | 0 | 1 | 0 | 0 | 2009-09-23T12:47:00.000 | 5 | 0.039979 | false | 1,465,769 | 0 | 0 | 1 | 1 | I'd like to run an appengine app on a subdomain
like something.no-ip.org instead of something.appspot.com
is this doable? If so, can you please help me understand? :)
Thank you so much for your help! |
Cross-platform help viewer with search functionality | 1,809,732 | 1 | 0 | 231 | 0 | python,documentation,cross-platform,chm | wxHtmlHelpController doesn't support any scripting within pages, nor does it support css. | 0 | 1 | 0 | 0 | 2009-09-23T20:20:00.000 | 2 | 0.099668 | false | 1,468,314 | 0 | 0 | 1 | 1 | I am looking for a help viewer like Windows CHM that basically provides support for
adding content in HTML format
define Table of Contents
decent search
It should work on Windows, Mac and Linux. Bonus points for also having support for generating a "plain HTML/javascript" version that can be viewed in any browser (albeit without search support).
Language preference: Python |
Time difference between system date and string, e.g. from directory name? | 1,487,702 | 1 | 0 | 289 | 0 | python,date,scripting | I would suggest using Python. You'll need the following functions:
os.listdir gives you the directory contents, as a list of strings
time.strptime(name, "%d-%m-%y") will try to parse such a string, and return a time tuple. You get a ValueError exception if parsing fails.
time.mktime will convert a time tuple into seconds since the epoch.
time.time returns seconds since the epoch
the smtplib module can send emails, assuming you know what SMTP server to use. Alternatively, you can run /usr/lib/sendmail, through the subprocess module (assuming /usr/lib/sendmail is correctly configured) | 0 | 1 | 0 | 1 | 2009-09-28T14:45:00.000 | 1 | 1.2 | true | 1,487,450 | 0 | 0 | 0 | 1 | I would like to write a small script that does the following (and that I can then run using my crontab):
Look into a directory that contains directories whose names are in some date format, e.g. 30-10-09.
Convert the directory name to the date it represents (of course, I could put this information as a string into a file in these directories, that doesn't matter to me).
Compare each date with the current system time and find the one that has a specific time difference to the current system date, e.g. less than two days.
Then, do something with the files in that directory (e.g., paste them together and send an email).
I know a little bash scripting, but I don't know whether bash can itself handle this. I think I could do this in R, but the server where this needs to run doesn't have R.
I'm curious anyway to learn a little bit of either Python or Ruby (both of which are on the server).
Can someone point me in the right direction what might be the best way to do this? |
How do I find out my PYTHONPATH using Python? | 62,773,911 | 0 | 447 | 822,516 | 0 | python,python-module,pythonpath | If using conda, you can get the env prefix using os.environ["CONDA_PREFIX"]. | 0 | 1 | 0 | 1 | 2009-09-28T22:01:00.000 | 10 | 0 | false | 1,489,599 | 1 | 0 | 0 | 1 | How do I find out which directories are listed in my system’s PYTHONPATH variable, from within a Python script (or the interactive shell)? |
Embeddable Workflow/BPM Library For Python? | 1,493,731 | 3 | 7 | 9,645 | 0 | python,workflow,business-process-management | Oh yes, tons. But most of them depend on a specific framework. DCWorkflow is integrated with Zopes CMF, for example. hurry.workflow is for Zope 3, etc. SpiffWorkflow presumes sql-alchemy, etc. This is because you need to have something to apply the workflow to, and that means you need to make some basic assumptions on the objects you use.
Hurry.workflow is probably one of the more independent ones, but it still assumes both that you use the Persistence library (and therefore in practice ZODB), and zope3's security model.
So you probably need to expand a bit on your requirements here... | 0 | 1 | 0 | 0 | 2009-09-29T16:12:00.000 | 2 | 1.2 | true | 1,493,550 | 0 | 0 | 0 | 1 | Let's say you are building a Python-based web app that requires some workflow management such as that in jBPM or Windows Workflow Foundation. Is there a library that offers this in the Python world? |
how to obtain physical drives in Windows | 1,497,789 | 1 | 2 | 5,364 | 0 | python,windows | Also you can try win32 module for Python. | 0 | 1 | 0 | 0 | 2009-09-30T08:47:00.000 | 4 | 0.049958 | false | 1,496,842 | 0 | 0 | 0 | 1 | I'm programming in Python with a wrapper of the kernel32 dll, so I can use any functions of this dll, like GetLogicalDrives(), for instance. I'm trying to obtain the information of the physical drives, even if they are not mounted. I've seen a question similar to this, but I need the information of the not mounted drives. All methods I've seen need a directory or a file in the device, but if it's not mounted, I can't have one, so the question is:
Is there a method which can provide me a list of the physical drives in the system, even if they are not mounted?
I have to say that using the Windows Registry, I've obtained the number of physical drives in "HKEY_LOCAL_MACHINE\Hardware\Devicemap\Scsi\Scsi Port x", because inside of this key, you can see the number of drives, including cd-rom devices or floppy devices. But I need size of the not mounted devices also, so... |
Performance of Python worth the cost? | 1,498,739 | 5 | 5 | 1,593 | 0 | python,c,embedded,fuzzy-logic | Make it work, then make it work fast. | 0 | 1 | 0 | 1 | 2009-09-30T13:32:00.000 | 6 | 0.16514 | false | 1,498,155 | 0 | 0 | 0 | 6 | I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries.
I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM).
The main concern is that response times are as fast as possible (an update rate of 5hz+ would be ideal >2Hz is required). The system would be reading from multiple (probably 5) sensors from an RS232 port and provide 2/3 outputs based on the results of the fuzzy evaluation.
Should I be concerned that Python will be too slow for this task? |
Performance of Python worth the cost? | 1,499,253 | 1 | 5 | 1,593 | 0 | python,c,embedded,fuzzy-logic | If most of your runtime is spent in C libraries, the language you use to call these libraries isn't important. What language are your time-eating libraries written in ? | 0 | 1 | 0 | 1 | 2009-09-30T13:32:00.000 | 6 | 0.033321 | false | 1,498,155 | 0 | 0 | 0 | 6 | I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries.
I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM).
The main concern is that response times are as fast as possible (an update rate of 5hz+ would be ideal >2Hz is required). The system would be reading from multiple (probably 5) sensors from an RS232 port and provide 2/3 outputs based on the results of the fuzzy evaluation.
Should I be concerned that Python will be too slow for this task? |
Performance of Python worth the cost? | 1,502,231 | 0 | 5 | 1,593 | 0 | python,c,embedded,fuzzy-logic | From your description, speed should not be much of a concern (and you can use C, cython, whatever you want to make it faster), but memory would be. For environments with 64 Mb max (where the OS and all should fit as well, right ?), I think there is a good chance that python may not be the right tool for target deployment.
If you have non trivial logic to handle, I would still prototype in python, though. | 0 | 1 | 0 | 1 | 2009-09-30T13:32:00.000 | 6 | 0 | false | 1,498,155 | 0 | 0 | 0 | 6 | I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries.
I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM).
The main concern is that response times are as fast as possible (an update rate of 5hz+ would be ideal >2Hz is required). The system would be reading from multiple (probably 5) sensors from an RS232 port and provide 2/3 outputs based on the results of the fuzzy evaluation.
Should I be concerned that Python will be too slow for this task? |
Performance of Python worth the cost? | 1,612,690 | 0 | 5 | 1,593 | 0 | python,c,embedded,fuzzy-logic | I never really measured the performance of pyfuzzy's examples, but as the new version 0.1.0 can read FCL files as FFLL does. Just describe your fuzzy system in this format, write some wrappers, and check the performance of both variants.
For reading FCL with pyfuzzy you need the antlr python runtime, but after reading you should be able to pickle the read object, so you don't need the antlr overhead on the target. | 0 | 1 | 0 | 1 | 2009-09-30T13:32:00.000 | 6 | 0 | false | 1,498,155 | 0 | 0 | 0 | 6 | I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries.
I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM).
The main concern is that response times are as fast as possible (an update rate of 5hz+ would be ideal >2Hz is required). The system would be reading from multiple (probably 5) sensors from an RS232 port and provide 2/3 outputs based on the results of the fuzzy evaluation.
Should I be concerned that Python will be too slow for this task? |
Performance of Python worth the cost? | 1,498,214 | 35 | 5 | 1,593 | 0 | python,c,embedded,fuzzy-logic | In general, you shouldn't obsess over performance until you've actually seen it become a problem. Since we don't know the details of your app, we can't say how it'd perform if implemented in Python. And since you haven't implemented it yet, neither can you.
Implement the version you're most comfortable with, and can implement fastest, first. Then benchmark it. And if it is too slow, you have three options which should be done in order:
First, optimize your Python code
If that's not enough, write the most performance-critical functions in C/C++, and call that from your Python code
And finally, if you really need top performance, you might have to rewrite the whole thing in C++. But then at least you'll have a working prototype in Python, and you'll have a much clearer idea of how it should be implemented. You'll know what pitfalls to avoid, and you'll have an already correct implementation to test against and compare results to. | 0 | 1 | 0 | 1 | 2009-09-30T13:32:00.000 | 6 | 1.2 | true | 1,498,155 | 0 | 0 | 0 | 6 | I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries.
I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM).
The main concern is that response times are as fast as possible (an update rate of 5hz+ would be ideal >2Hz is required). The system would be reading from multiple (probably 5) sensors from an RS232 port and provide 2/3 outputs based on the results of the fuzzy evaluation.
Should I be concerned that Python will be too slow for this task? |
Performance of Python worth the cost? | 1,498,176 | 12 | 5 | 1,593 | 0 | python,c,embedded,fuzzy-logic | Python is very slow at handling large amounts of non-string data. For some operations, you may see that it is 1000 times slower than C/C++, so yes, you should investigate into this and do necessary benchmarks before you make time-critical algorithms in Python.
However, you can extend python with modules in C/C++ code, so that time-critical things are fast, while still being able to use python for the main code. | 0 | 1 | 0 | 1 | 2009-09-30T13:32:00.000 | 6 | 1 | false | 1,498,155 | 0 | 0 | 0 | 6 | I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries.
I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM).
The main concern is that response times are as fast as possible (an update rate of 5hz+ would be ideal >2Hz is required). The system would be reading from multiple (probably 5) sensors from an RS232 port and provide 2/3 outputs based on the results of the fuzzy evaluation.
Should I be concerned that Python will be too slow for this task? |
Running python script as another user | 1,499,282 | -1 | 14 | 33,209 | 0 | python,linux | Use the command sudo.
In order to run a program as a user, the system must "authenticate" that user.
Obviously, root can run any program as any user, and any user can su to another user with a password.
The program sudo can be configured to allow a group of users to sudo a particular command as a particular user.
For example, you could create a group scriptUsers and a user scriptRun. Then, configure sudo to let any user in scriptUsers become scriptRun ONLY to run your script. | 0 | 1 | 0 | 1 | 2009-09-30T16:31:00.000 | 3 | -0.066568 | false | 1,499,268 | 0 | 0 | 0 | 2 | On a Linux box I want to run a Python script as another user.
I've already made a wrapper program in C++ that calls the script, since I've realized that the ownership of running the script is decided by the ownership of the python interpreter. After that I change the C++ program to a different user and run the C++ program.
This setup doesn't seem to be working. Any ideas? |
Running python script as another user | 1,499,313 | 0 | 14 | 33,209 | 0 | python,linux | Give those users the ability to sudo su $dedicated_username and tailor the permissions on your system so that $dedicated_user has sufficient, but not excessive, access. | 0 | 1 | 0 | 1 | 2009-09-30T16:31:00.000 | 3 | 0 | false | 1,499,268 | 0 | 0 | 0 | 2 | On a Linux box I want to run a Python script as another user.
I've already made a wrapper program in C++ that calls the script, since I've realized that the ownership of running the script is decided by the ownership of the python interpreter. After that I change the C++ program to a different user and run the C++ program.
This setup doesn't seem to be working. Any ideas? |
With multiple Python installs, how does MacPorts know which one to install MySQLdb for? | 2,302,542 | 1 | 0 | 1,051 | 1 | python,mysql,macos | You also need python_select (or is it select_python?) to change the default python used. | 0 | 1 | 0 | 0 | 2009-09-30T17:32:00.000 | 2 | 0.099668 | false | 1,499,572 | 0 | 0 | 0 | 1 | I just upgraded the default Python 2.5 on Leopard to 2.6 via the installer on www.python.org. Upon doing so, the MySQLdb I had installed was no longer found. So I tried reinstalling it via port install py-mysql, and it succeeded, but MySQLdb was still not importable. So then I tried to python install python26 with python_select python26 and it succeeded, but it doesn't appear that it is getting precedence over the python.org install:
$ which python
/Library/Frameworks/Python.framework/Versions/2.6/bin/python
When I would expect it to be something like /opt/local/bin/python
My path environment is: /Library/Frameworks/Python.framework/Versions/2.6/bin:/usr/local/mysql/bin/:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/mysql/bin:/Users/bsr/bin
Anyway, when I try port install py-mysql but how does it know where to install the Python MySQL library? |
Run a task every hour on the hour with App Engine's cron API | 1,501,925 | -1 | 4 | 3,297 | 0 | python,google-app-engine,cron | Looking over the docs, I agree that your 24 cron entry idea is the only documented way that would work. Not ideal, but should work. | 0 | 1 | 0 | 0 | 2009-10-01T04:36:00.000 | 4 | -0.049958 | false | 1,501,907 | 0 | 0 | 1 | 2 | I need to run a task every hour on the hour (00:00, 01:00, 02:00, ..., 23:00) every day of the week, but can't seem to find an example in App Engine's docs of how to do this.
There is an example of running at ask every hour, but this doesn't fit because the "start" of that hour depends on when you deploy the application. That is, if I deploy at 4:37 PM, the cron scripts will get executed at 5:37, 6:37, ... instead of 5:00, 6:00, ...
So far the only way that looks like it would work is to have 24 different cron entries, one for the specific hour of each day set to run each day at that specific time.
Does anyone know of anything that would let me use a schedule like "every hour at :00" or even "every day 00:00, 01:00, ... 23:00"? |
Run a task every hour on the hour with App Engine's cron API | 1,501,960 | 1 | 4 | 3,297 | 0 | python,google-app-engine,cron | The docs say you can have 20 cron entries, so you can't have one for every hour of the day.
You could run your task every minute and check if it is the first minute of the hour - exit otherwise. | 0 | 1 | 0 | 0 | 2009-10-01T04:36:00.000 | 4 | 0.049958 | false | 1,501,907 | 0 | 0 | 1 | 2 | I need to run a task every hour on the hour (00:00, 01:00, 02:00, ..., 23:00) every day of the week, but can't seem to find an example in App Engine's docs of how to do this.
There is an example of running at ask every hour, but this doesn't fit because the "start" of that hour depends on when you deploy the application. That is, if I deploy at 4:37 PM, the cron scripts will get executed at 5:37, 6:37, ... instead of 5:00, 6:00, ...
So far the only way that looks like it would work is to have 24 different cron entries, one for the specific hour of each day set to run each day at that specific time.
Does anyone know of anything that would let me use a schedule like "every hour at :00" or even "every day 00:00, 01:00, ... 23:00"? |
Using CherryPy as a blocking/non-threading server for easier debugging | 1,502,612 | 3 | 1 | 934 | 0 | python,debugging,cherrypy | No. Not only does the wsgiserver start its own set of worker threads (10 by default, but even if you only specified 1 that's still 1 thread for the listening socket and 1 worker thread). Even if that were not true, if you use the rest of CherryPy (i.e. the engine), it runs that 1 listener thread in a separate thread from the main thread. | 0 | 1 | 0 | 0 | 2009-10-01T07:37:00.000 | 1 | 0.53705 | false | 1,502,431 | 1 | 0 | 0 | 1 | Is it possible to use the CherrPy server as a blocking/non-threading server (for easier debugging?) |
Network programming abstraction, decomposition | 1,506,213 | 0 | 0 | 290 | 0 | python,networking,network-programming,twisted | Why not use a database instead of "just a structure"? Both relational and non-relational DBs offer many practical advantages (separate processes using them, take care of replication [[and/or snapshots, backups, ...]], rich functionality if you need it for the "queries", and so on, and so forth).
Worst case, the "just a structure" can be handled by a third process that's entirely dedicated to it (basically mimicking what any DB engine would offer -- though the engine would probably do it better and faster;-), allowing you to at least keep a good decomposition (with the two server processes both interacting with the "datastore process"). | 0 | 1 | 0 | 0 | 2009-10-01T18:45:00.000 | 3 | 0 | false | 1,505,744 | 0 | 0 | 1 | 1 | I have a problem as follows:
Server process 1
Constantly sends updates that occur to a datastore
Server process 2
Clients contact the server, which queries the datastore, and returns a result
The thing is, the results that process 1 and process 2 are sending back the client are totally different and unrelated.
How does one decompose this?
Do you just have one process constantly sending data, and define the protocol to have a bit which corresponds to whether the return type is 1 or 2?
Do you have two processes? How do they share the datastore then (it is just a structure not a database)?
Thanks! |
can't install lxml (python 2.6.3, osx 10.6 snow leopard) | 1,513,810 | 3 | 4 | 2,271 | 0 | python,macos,port,osx-leopard,lxml | Ned :
incompatible changes in the 2.6.3 version of python's distutil
Not precisely. The API hasn't changed but Setuptools overrides them, and makes the assumption they are called in a particular order.
Lennart:
The Distribute installation doesn't seem to trigger the bug
Yes indeed, this precise bug was detected some time ago and fixed in Distribute (and in Ubuntu's setuptools package) | 0 | 1 | 0 | 0 | 2009-10-03T01:33:00.000 | 2 | 0.291313 | false | 1,512,530 | 1 | 0 | 0 | 1 | I try to:
easy_install lxml
and I get this error:
File "build/bdist.macosx-10.3-fat/egg/setuptools/command/build_ext.py", line 85, in get_ext_filename
KeyError: 'etree'
any hints? |
Deploying a web service to my Google App Engine application | 1,514,062 | 1 | 0 | 369 | 0 | iphone,python,web-services,google-app-engine | Looks like you're not setting the Content-Type header correctly in your service (assuming you ARE actually trying to send XML -- e.g. SOAP, XML-RPC, &c). What code are you using to set that header? Without some indication about what protocol you're implementing and via what framework, it's impossible to help in detail...! | 0 | 1 | 0 | 0 | 2009-10-03T07:04:00.000 | 2 | 0.099668 | false | 1,513,038 | 0 | 0 | 1 | 2 | We made a simple application and using GoogleAppEngineLauncher (GAEL) ran that locally. Then we deployed, using GAEL again, to our appid. It works fine.
Now, we made a web service. We ran that locally using GAEL and a very thin local python client. It works fine.
We deployed that, and we get this message when we try to visit our default page:
"Move along people, there is nothing to see here"
We modified our local client and tried to run that against our google site and we got an error that looked like:
Response is "text/plain", not "text/xml"
Any ideas where we are falling down in our deployment or config for using a web service with google app engine?
Any help appreciated!
Thanks // :) |
Deploying a web service to my Google App Engine application | 1,604,138 | 0 | 0 | 369 | 0 | iphone,python,web-services,google-app-engine | Looks like we aren't going to get to the bottom of this one. Just not enough information available at debug time. We've managed to affect a fix on the service, although I hate ot admit it we never found out what was causing this bug. | 0 | 1 | 0 | 0 | 2009-10-03T07:04:00.000 | 2 | 1.2 | true | 1,513,038 | 0 | 0 | 1 | 2 | We made a simple application and using GoogleAppEngineLauncher (GAEL) ran that locally. Then we deployed, using GAEL again, to our appid. It works fine.
Now, we made a web service. We ran that locally using GAEL and a very thin local python client. It works fine.
We deployed that, and we get this message when we try to visit our default page:
"Move along people, there is nothing to see here"
We modified our local client and tried to run that against our google site and we got an error that looked like:
Response is "text/plain", not "text/xml"
Any ideas where we are falling down in our deployment or config for using a web service with google app engine?
Any help appreciated!
Thanks // :) |
How can I detect when a flash drive is plugged in under Linux? | 1,518,829 | 1 | 5 | 6,498 | 0 | python,linux | When an USB device is plugged in syslog writes messages concerning this to /var/log/messages. The "dmesg" command shows this log. You can check near the end of the log to see which channel the device was attached to, it is usually /dev/sd(letter)(number) depending on the partitions and number of serial disks plugged into the system. | 0 | 1 | 0 | 0 | 2009-10-05T07:40:00.000 | 6 | 0.033321 | false | 1,518,699 | 0 | 0 | 0 | 3 | How can I detect when a flash drive is plugged in? I'm using a bare Debian installation, without any GUI and want to be notified in my Python script when a new flash drive appears... I know that D-BUS distributes such information, but i dont want to use D-BUS. Is there a more bare access to that information? Shouldn't that be available under /proc or /sys? How can I "connect" to that source?
Bye
falstaff |
How can I detect when a flash drive is plugged in under Linux? | 16,370,716 | 0 | 5 | 6,498 | 0 | python,linux | I did this using zenity in a script and udev with rule on rhel6 with:
KERNEL=="sd[b-d]", DRIVERS=="usb", ACTION=="add", RUN+="/path/to/script" | 0 | 1 | 0 | 0 | 2009-10-05T07:40:00.000 | 6 | 0 | false | 1,518,699 | 0 | 0 | 0 | 3 | How can I detect when a flash drive is plugged in? I'm using a bare Debian installation, without any GUI and want to be notified in my Python script when a new flash drive appears... I know that D-BUS distributes such information, but i dont want to use D-BUS. Is there a more bare access to that information? Shouldn't that be available under /proc or /sys? How can I "connect" to that source?
Bye
falstaff |
How can I detect when a flash drive is plugged in under Linux? | 1,518,728 | 0 | 5 | 6,498 | 0 | python,linux | /proc/partitions shows all the partitions known to the kernel. | 0 | 1 | 0 | 0 | 2009-10-05T07:40:00.000 | 6 | 0 | false | 1,518,699 | 0 | 0 | 0 | 3 | How can I detect when a flash drive is plugged in? I'm using a bare Debian installation, without any GUI and want to be notified in my Python script when a new flash drive appears... I know that D-BUS distributes such information, but i dont want to use D-BUS. Is there a more bare access to that information? Shouldn't that be available under /proc or /sys? How can I "connect" to that source?
Bye
falstaff |
Basic Comet in Python using just std lib | 1,751,708 | 0 | 1 | 719 | 0 | python,comet | Extending what lost-theory has said, if you want to use comet for a passing messages between clients then you need to implement something like pubsub.
Using something like tornado for the pubsub is much simpler than with the single threaded wsgiref servers. | 0 | 1 | 0 | 0 | 2009-10-05T16:04:00.000 | 3 | 0 | false | 1,520,953 | 0 | 0 | 1 | 2 | I'm developing a web interface for an already existing desktop application. I've been looking for a way to allow the server to push content to the browser and ended up reaching Comet.
Navigating through the internet, and most of the questions here, I got answers like twisted, orbited, tornado and most of them even point to java applications like Jetty or StreamHub.
Without going too much deeper in this, I'd like to know is there's a chance to implement Comet-like communication using just standard lib modules like BaseHTTPServer and keep things as simple as possible as I don't need so much power and efficiency.
Note: Jython is a possibility, but I'd like to keep it with as less requirements as possible. |
Basic Comet in Python using just std lib | 1,520,980 | 0 | 1 | 719 | 0 | python,comet | This is possible. Just don't close the connection to the client. | 0 | 1 | 0 | 0 | 2009-10-05T16:04:00.000 | 3 | 0 | false | 1,520,953 | 0 | 0 | 1 | 2 | I'm developing a web interface for an already existing desktop application. I've been looking for a way to allow the server to push content to the browser and ended up reaching Comet.
Navigating through the internet, and most of the questions here, I got answers like twisted, orbited, tornado and most of them even point to java applications like Jetty or StreamHub.
Without going too much deeper in this, I'd like to know is there's a chance to implement Comet-like communication using just standard lib modules like BaseHTTPServer and keep things as simple as possible as I don't need so much power and efficiency.
Note: Jython is a possibility, but I'd like to keep it with as less requirements as possible. |
Werkzeug in General, and in Python 3.1 | 1,622,505 | 1 | 2 | 2,259 | 1 | python,python-3.x,werkzeug | I can only answer question one:
I started using it for some small webstuff but now moved on to rework larger apps with it. Why Werkzeug? The modular concept is really helpful. You can hook in modules as you like, make stuff easily context aware and you get good request file handling for free which is able to cope with 300mb+ files by not storing it in memory.
Disadvantages... Well sometimes modularity needs some upfront thought (django f.ex. gives you everything all at once, stripping stuff out is hard to do there though) but for me it works fine. | 0 | 1 | 0 | 0 | 2009-10-06T05:13:00.000 | 3 | 0.066568 | false | 1,523,706 | 0 | 0 | 1 | 3 | I've been looking really hard at all of the way**(s)** one can develop web applications using Python. For reference, we are using RHEL 64bit, apache, mod_wsgi.
History:
PHP + MySQL years ago
PHP + Python 2.x + MySQL recently and current
Python + PostgreSQL working on it
We use a great library for communicating between PHP and Python (interface in PHP, backend in Python)... However, with a larger upcoming project starting, using 100% python may be very advantagous.
We typically prefer not to have a monolithic framework dictating how things are done. A collection of useful helpers and utilities are much preferred (be it PHP or Python).
Question 1:
In reading a number of answers from experienced Python users, I've seen Werkzeug recommended a number of times. I would love it if several people with direct experience using Werkzeug to develop professional web applications could comment (in as much detail as their fingers feel like) why they use it, why they like it, and anything to watch out for.
Question 2:
Is there a version of Werkzeug that supports Python 3.1.1. I've succefully installed mod_wsgi on Apache 2.2 with Python 3.1.1.
If there is not a version, what would it take to upgrade it to work on Python 3.1?
Note: I've run 2to3 on the Werkzeug source code, and it does python-compile without
Edit:
The project that we are starting is not slated to be finished until nearly a year from now. At which point, I'm guessing Python 3.X will be a lot more mainstream. Furthermore, considering that we are running the App (not distributing it), can anyone comment on the viability of bashing through some of the Python 3 issues now, so that when a year from now arrives, we are more-or-less already there?
Thoughts appreciated! |
Werkzeug in General, and in Python 3.1 | 1,523,934 | 1 | 2 | 2,259 | 1 | python,python-3.x,werkzeug | I haven't used Werkzeug, so I can only answer question 2:
No, Werkzeug does not work on Python 3. In fact, very little works on Python 3 as of today. Porting is not difficult, but you can't port until all your third-party libraries have been ported, so progress is slow.
One big stopper has been setuptools, which is a very popular package to use. Setuptools is unmaintained, but there is a maintained fork called Distribute. Distribute was released with Python 3 support just a week or two ago. I hope package support for Python 3 will pick up now. But it will still be a long time, at least months probably a year or so, before any major project like Werkzeug will be ported to Python 3. | 0 | 1 | 0 | 0 | 2009-10-06T05:13:00.000 | 3 | 0.066568 | false | 1,523,706 | 0 | 0 | 1 | 3 | I've been looking really hard at all of the way**(s)** one can develop web applications using Python. For reference, we are using RHEL 64bit, apache, mod_wsgi.
History:
PHP + MySQL years ago
PHP + Python 2.x + MySQL recently and current
Python + PostgreSQL working on it
We use a great library for communicating between PHP and Python (interface in PHP, backend in Python)... However, with a larger upcoming project starting, using 100% python may be very advantagous.
We typically prefer not to have a monolithic framework dictating how things are done. A collection of useful helpers and utilities are much preferred (be it PHP or Python).
Question 1:
In reading a number of answers from experienced Python users, I've seen Werkzeug recommended a number of times. I would love it if several people with direct experience using Werkzeug to develop professional web applications could comment (in as much detail as their fingers feel like) why they use it, why they like it, and anything to watch out for.
Question 2:
Is there a version of Werkzeug that supports Python 3.1.1. I've succefully installed mod_wsgi on Apache 2.2 with Python 3.1.1.
If there is not a version, what would it take to upgrade it to work on Python 3.1?
Note: I've run 2to3 on the Werkzeug source code, and it does python-compile without
Edit:
The project that we are starting is not slated to be finished until nearly a year from now. At which point, I'm guessing Python 3.X will be a lot more mainstream. Furthermore, considering that we are running the App (not distributing it), can anyone comment on the viability of bashing through some of the Python 3 issues now, so that when a year from now arrives, we are more-or-less already there?
Thoughts appreciated! |
Werkzeug in General, and in Python 3.1 | 1,525,943 | 3 | 2 | 2,259 | 1 | python,python-3.x,werkzeug | mod_wsgi for Python 3.x is also not ready. There is no satisfactory definition of WSGI for Python 3.x yet; the WEB-SIG are still bashing out the issues. mod_wsgi targets a guess at what might be in it, but there are very likely to be changes to both the spec and to standard libraries. Any web application you write today in Python 3.1 is likely to break in the future.
It's a bit of a shambles. Today, for webapps you can only realistically use Python 2.x. | 0 | 1 | 0 | 0 | 2009-10-06T05:13:00.000 | 3 | 0.197375 | false | 1,523,706 | 0 | 0 | 1 | 3 | I've been looking really hard at all of the way**(s)** one can develop web applications using Python. For reference, we are using RHEL 64bit, apache, mod_wsgi.
History:
PHP + MySQL years ago
PHP + Python 2.x + MySQL recently and current
Python + PostgreSQL working on it
We use a great library for communicating between PHP and Python (interface in PHP, backend in Python)... However, with a larger upcoming project starting, using 100% python may be very advantagous.
We typically prefer not to have a monolithic framework dictating how things are done. A collection of useful helpers and utilities are much preferred (be it PHP or Python).
Question 1:
In reading a number of answers from experienced Python users, I've seen Werkzeug recommended a number of times. I would love it if several people with direct experience using Werkzeug to develop professional web applications could comment (in as much detail as their fingers feel like) why they use it, why they like it, and anything to watch out for.
Question 2:
Is there a version of Werkzeug that supports Python 3.1.1. I've succefully installed mod_wsgi on Apache 2.2 with Python 3.1.1.
If there is not a version, what would it take to upgrade it to work on Python 3.1?
Note: I've run 2to3 on the Werkzeug source code, and it does python-compile without
Edit:
The project that we are starting is not slated to be finished until nearly a year from now. At which point, I'm guessing Python 3.X will be a lot more mainstream. Furthermore, considering that we are running the App (not distributing it), can anyone comment on the viability of bashing through some of the Python 3 issues now, so that when a year from now arrives, we are more-or-less already there?
Thoughts appreciated! |
Reasons to use distutils when packaging C/Python project | 1,523,993 | 1 | 0 | 284 | 0 | python,c,packaging,distutils | distutils can be used to install end user programs, but it's most useful when using it for Python libraries, as it can create source packages and also install them in the correct place. For that I would say it's more or less required.
But for an end user Python program you can also use make or whatever you like and are used to, as you don't need to install any code in the Python site-packages directory, and you don't need to put your code onto PyPI and it doesn't need to be accessible from other Python-code.
I don't think distutils will be neither more or less complicated to use in installing an end-user program compared to other tools. All such install/packaging tools are hella-complex, as Cartman would have said. | 0 | 1 | 0 | 1 | 2009-10-06T06:17:00.000 | 2 | 1.2 | true | 1,523,874 | 0 | 0 | 0 | 2 | I have an open source project containing both Python and C code. I'm wondering that is there any use for distutils for me, because I'm planning to do a ubuntu/debian package. The C code is not something that I could or want to use as Python extension. C and Python programs communicate with TCP/IP through localhost.
So the bottom line here is that while I'm learning packaging, does the usage of distutils specific files only make me more confused since I can't use my C-code as Python extensions? Or should I divide my C and Python functionality to separate projects to be able to understand packaging concepts better? |
Reasons to use distutils when packaging C/Python project | 1,525,194 | 1 | 0 | 284 | 0 | python,c,packaging,distutils | Because it uses an unified python setup.py install command? distutils, or setuptools? Whatever, just use one of those.
For development, it's also really useful because you don't have to care where to find such and such dependency. As long as it's standard Python/basic system library stuff, setup.py should find it for you. With setup.py, you don't require anymore ./configure stuff or ugly autotools to create huge Makefiles. It just works (tm) | 0 | 1 | 0 | 1 | 2009-10-06T06:17:00.000 | 2 | 0.099668 | false | 1,523,874 | 0 | 0 | 0 | 2 | I have an open source project containing both Python and C code. I'm wondering that is there any use for distutils for me, because I'm planning to do a ubuntu/debian package. The C code is not something that I could or want to use as Python extension. C and Python programs communicate with TCP/IP through localhost.
So the bottom line here is that while I'm learning packaging, does the usage of distutils specific files only make me more confused since I can't use my C-code as Python extensions? Or should I divide my C and Python functionality to separate projects to be able to understand packaging concepts better? |
how to create new file using python | 1,529,596 | 1 | 1 | 1,509 | 0 | python,macos,osx-leopard | It probably failed because /var/log has user set to root and group set to wheel. Try running your python code as root and it will probably work. | 0 | 1 | 0 | 0 | 2009-10-07T05:07:00.000 | 3 | 0.066568 | false | 1,529,584 | 1 | 0 | 0 | 1 | how can i create new file in /var/log directory using python language in OSX leopard? i tried to do it using os.open function but i get "permission denied"
thanks in advance |
Reading HKEY CURRENT USER from the registry in Python, specifying the user | 1,532,868 | 2 | 1 | 8,899 | 0 | python,windows,registry | HKEY_CURRENT_USER maps to a HKEY_USERS\{id} key.
Try finding the id by matching the HKEY_USERS{id}\Volatile Environment\USERNAME key to the username of the user (by enumerating/iterating over the {id}s that are present on the system). When you find the match just use HKEY_USERS{id} as if it was HKEY_CURRENT_USER | 0 | 1 | 0 | 0 | 2009-10-07T15:20:00.000 | 3 | 0.132549 | false | 1,532,306 | 1 | 0 | 0 | 1 | In my application I run subprocesses under several different user accounts. I need to be able to read some of the information written to the registry by these subprocesses. Each one is writing to HKEY_CURRENT_USER, and I know the user account name that they are running under.
In Python, how can I read values from HKEY_CURRENT_USER for a specific user? I assume I need to somehow load the registry values under the user's name, and then read them from there, but how?
edit: Just to make sure it's clear, my Python program is running as Administrator, and I have accounts "user1", "user2", and "user3", which each have information in their own HKEY_CURRENT_USER. As Administrator, how do I read user1's HKEY_CURRENT_USER data? |
Use different Python version with virtualenv | 65,076,532 | 1 | 1,453 | 1,338,259 | 0 | python,virtualenv,virtualenvwrapper | Surprised that no one has mentioned conda so far. I have found this is a lot more straightforward than the other methods mentioned here. Let's say I have python 3.9 and python 2.7 and a project I am working on was python 3.5.4, I could simply create the isolated virtual env for 3.5.4 with the conda command without downloading anything else.
To see a list of available python versions first, use the command
conda search "^python$"
To create the virtual environment for python version x.y.z, use the command
conda create -n yourenvname python=x.y.z
Activate venv with
conda activate yourenvname
Deactivate with
conda deactivate
To delete the virtual environment when done, use the command
conda remove -n yourenvname --all | 0 | 1 | 0 | 0 | 2009-10-07T21:11:00.000 | 36 | 0.005555 | false | 1,534,210 | 1 | 0 | 0 | 6 | I have a Debian system currently running with python 2.5.4. I got virtualenv properly installed, everything is working fine. Is there a possibility that I can use a virtualenv with a different version of Python?
I compiled Python 2.6.2 and would like to use it with some virtualenv. Is it enough to overwrite the binary file? Or do I have to change something in respect to the libraries? |
Use different Python version with virtualenv | 57,087,622 | 1 | 1,453 | 1,338,259 | 0 | python,virtualenv,virtualenvwrapper | Yes you just need to install the other version of python, and define the location of your other version of python in your command like :
virtualenv /home/payroll/Documents/env -p /usr/bin/python3 | 0 | 1 | 0 | 0 | 2009-10-07T21:11:00.000 | 36 | 0.005555 | false | 1,534,210 | 1 | 0 | 0 | 6 | I have a Debian system currently running with python 2.5.4. I got virtualenv properly installed, everything is working fine. Is there a possibility that I can use a virtualenv with a different version of Python?
I compiled Python 2.6.2 and would like to use it with some virtualenv. Is it enough to overwrite the binary file? Or do I have to change something in respect to the libraries? |
Use different Python version with virtualenv | 55,512,212 | 2 | 1,453 | 1,338,259 | 0 | python,virtualenv,virtualenvwrapper | This was a bug with virtualenv.
Just upgrading your pip should be the fix.
pip install --upgrade virtualenv | 0 | 1 | 0 | 0 | 2009-10-07T21:11:00.000 | 36 | 0.011111 | false | 1,534,210 | 1 | 0 | 0 | 6 | I have a Debian system currently running with python 2.5.4. I got virtualenv properly installed, everything is working fine. Is there a possibility that I can use a virtualenv with a different version of Python?
I compiled Python 2.6.2 and would like to use it with some virtualenv. Is it enough to overwrite the binary file? Or do I have to change something in respect to the libraries? |
Use different Python version with virtualenv | 56,665,285 | 1 | 1,453 | 1,338,259 | 0 | python,virtualenv,virtualenvwrapper | It worked for me on windows with python 2 installation :
Step 1: Install python 3 version .
Step 2: create a env folder for
the virtual environment.
Step 3 : c:\Python37\python -m venv
c:\path\to\env.
This is how i created Python 3 virtual environment on my existing python 2 installation. | 0 | 1 | 0 | 0 | 2009-10-07T21:11:00.000 | 36 | 0.005555 | false | 1,534,210 | 1 | 0 | 0 | 6 | I have a Debian system currently running with python 2.5.4. I got virtualenv properly installed, everything is working fine. Is there a possibility that I can use a virtualenv with a different version of Python?
I compiled Python 2.6.2 and would like to use it with some virtualenv. Is it enough to overwrite the binary file? Or do I have to change something in respect to the libraries? |
Use different Python version with virtualenv | 51,188,487 | 23 | 1,453 | 1,338,259 | 0 | python,virtualenv,virtualenvwrapper | These two commands should work fine.
virtualenv -p python2 myenv (For python2)
virtualenv -p python3 myenv (For python3) | 0 | 1 | 0 | 0 | 2009-10-07T21:11:00.000 | 36 | 1 | false | 1,534,210 | 1 | 0 | 0 | 6 | I have a Debian system currently running with python 2.5.4. I got virtualenv properly installed, everything is working fine. Is there a possibility that I can use a virtualenv with a different version of Python?
I compiled Python 2.6.2 and would like to use it with some virtualenv. Is it enough to overwrite the binary file? Or do I have to change something in respect to the libraries? |
Use different Python version with virtualenv | 39,574,443 | 8 | 1,453 | 1,338,259 | 0 | python,virtualenv,virtualenvwrapper | Even easier, by using command substitution to find python2 for you:
virtualenv -p $(which python2) <path/to/new/virtualenv/>
Or when using virtualenvwrapper :
mkvirtualenv -p $(which python2) <env_name> | 0 | 1 | 0 | 0 | 2009-10-07T21:11:00.000 | 36 | 1 | false | 1,534,210 | 1 | 0 | 0 | 6 | I have a Debian system currently running with python 2.5.4. I got virtualenv properly installed, everything is working fine. Is there a possibility that I can use a virtualenv with a different version of Python?
I compiled Python 2.6.2 and would like to use it with some virtualenv. Is it enough to overwrite the binary file? Or do I have to change something in respect to the libraries? |
A .net wrapper for Google App Engine? | 17,356,271 | 0 | 3 | 3,521 | 0 | java,.net,python,web-services,google-app-engine | Python has a .NET alternative called IronPython. But I don't think it will work in GAE as it supports only pure python. I am also facing a similar problem trying to port a source written in C#.net into GAE compatible code. I'm going to work around it by re-inventing the spokes of the wheel (not the wheel itself) by re-doing the UI using SVG or some other method. Have you considered that? | 0 | 1 | 0 | 0 | 2009-10-09T03:59:00.000 | 3 | 0 | false | 1,541,722 | 0 | 0 | 1 | 1 | Does anyone know of a .net wrapper around either python or java Google App Engine services?
Any help appreciated // :) |
Upgrade Python to 2.6 on Mac | 1,541,785 | 6 | 14 | 13,472 | 0 | python,macos,installation,upgrade | May I suggest you leave the "Default" be, and install Python in /usr/local/bin.
Download python
Unzip it
./configure
make
sudo make install
done.
Since /usr/local/bin comes before /usr/bin in the $PATH, you will invoke 2.6 when you type python, but the OS will remain stable... | 0 | 1 | 0 | 0 | 2009-10-09T04:24:00.000 | 7 | 1 | false | 1,541,776 | 1 | 0 | 0 | 2 | I'd like to upgrade the default python installation (2.5.1) supplied with OS X Leopard to the latest version. Please let me know how I can achieve this.
Thanks |
Upgrade Python to 2.6 on Mac | 1,541,850 | 20 | 14 | 13,472 | 0 | python,macos,installation,upgrade | When an OS is distributed with some specific Python release and uses it for some OS functionality (as is the case with Mac OS X, as well as many Linux distros &c), you should not tamper in any way with the system-supplied Python (as in, "upgrading" it and the like): while Python strives for backwards compatibility within any major release (such as 2.* or 3.*, this can never be 100% guaranted; your OS supplied tested all functionality thoroughly with the specific Python version they distribute; if you manage to alter that version, "on your head be it" -- neither your OS supplier nor the PSF accepts any responsibility for whatever damage that might perhaps do to your system.
Rather, as other answers already suggested, install any other release you wish "besides" the system one -- why tamper with that crucial one, and risk breaking things, when installing others is so easy anyway?! On typical Mac OS X 10.5 machines (haven't upgraded any of my several macs to 10.6 yet), I have the Apple-supplied 2.5, a 2.4 on the side to support some old projects not worth the bother to upgrate, the latest 2.6 for new stuff, 3.1 as well to get the very newest -- they all live together in peace and quiet, I just type the release number explicitly, i.e. using python2.6 at the prompt, when I want a specific release. What release gets used when at the shell prompt you just say python is up to you (I personally prefer that to mean "the system-supplied Python", but it's a matter of taste: by setting paths, or shell aliases, &c, you can make it mean whatever you wish). | 0 | 1 | 0 | 0 | 2009-10-09T04:24:00.000 | 7 | 1 | false | 1,541,776 | 1 | 0 | 0 | 2 | I'd like to upgrade the default python installation (2.5.1) supplied with OS X Leopard to the latest version. Please let me know how I can achieve this.
Thanks |
Traffic shaping under Linux | 1,548,761 | 0 | 5 | 4,040 | 0 | python,linux,ubuntu,trafficshaping | Is there any reason you wish to use python? As mentioned, it will likely only hand-off to already developed tools for this purpose. However, if you look around, you can find things such as Click! modular router, XORP, and others that provide a drop-in for things you want to do - not to mention all the suggestions already provided (such as iptables and tc) | 0 | 1 | 0 | 0 | 2009-10-10T14:24:00.000 | 4 | 0 | false | 1,548,086 | 0 | 0 | 0 | 1 | Where can I learn about controlling/interrogating the network interface under Linux? I'd like to get specific application upload/download speeds, and enforce a speed limit for a specific application.
I'd particularly like information that can help me write a traffic shaping application using Python. |
Recommendations for perl-to-python interoperation? | 1,557,216 | 2 | 1 | 406 | 0 | python,perl | Well, if you really want to write the GUI in another language (which, seriously, is just a bad idea, since it will cost you more than it could ever benefit you), the thing you should do is the following:
Document your Perl app in terms of the services it provides. You should do it with XML Schema Definition - XSD - for the data types and Web Service Description Language - WSDL - for the actual service.
Implement the services in Perl, possibly using Catalyst::Controller::SOAP, or just XML::Compile::SOAP.
Consume the services from your whatever-language GUI interface.
Profit.
But honestly, I really suggest you taking a look at the Perl GTK2 binding, it is awesome, including features such as implementing a Gtk class entirely in Perl and using it as argument to a function written in C - for instance, you can write a model class for a gtk tree entirely in Perl. | 0 | 1 | 0 | 1 | 2009-10-12T20:22:00.000 | 8 | 0.049958 | false | 1,556,668 | 0 | 0 | 0 | 3 | We have a sizable code base in Perl. For the forseeable future, our codebase will remain in Perl. However, we're looking into adding a GUI-based dashboard utility. We are considering writing the dashboard in Python (using tkinter or wx). The problem, however, is that we would like to leverage our existing Perl codebase in the Python GUI.
So... any suggestions on how achieve this? We are considering a few options:
Write executables (in Perl) that mimic function calls; invoke those Perl executables in python as system calls.
Write Perl executables on-the-fly inside the Python dashboard, and invoke the (temporary) Perl executable.
Find some kind of Perl-to-Python converter or binding.
Any other ideas? I'd love to hear if other people have confronted this problem. Unfortunately, it's not an option to convert the codebase itself to Python at this time. |
Recommendations for perl-to-python interoperation? | 1,560,979 | 1 | 1 | 406 | 0 | python,perl | Interesting project: I would opt for loose-coupling and consider an XML-RPC or JSON based approach. | 0 | 1 | 0 | 1 | 2009-10-12T20:22:00.000 | 8 | 0.024995 | false | 1,556,668 | 0 | 0 | 0 | 3 | We have a sizable code base in Perl. For the forseeable future, our codebase will remain in Perl. However, we're looking into adding a GUI-based dashboard utility. We are considering writing the dashboard in Python (using tkinter or wx). The problem, however, is that we would like to leverage our existing Perl codebase in the Python GUI.
So... any suggestions on how achieve this? We are considering a few options:
Write executables (in Perl) that mimic function calls; invoke those Perl executables in python as system calls.
Write Perl executables on-the-fly inside the Python dashboard, and invoke the (temporary) Perl executable.
Find some kind of Perl-to-Python converter or binding.
Any other ideas? I'd love to hear if other people have confronted this problem. Unfortunately, it's not an option to convert the codebase itself to Python at this time. |
Recommendations for perl-to-python interoperation? | 1,557,825 | 7 | 1 | 406 | 0 | python,perl | I hate to be another one in the chorus, but...
Avoid the use of an alternate language
Use Wx so it's native look and feel makes the application look "real" to non-technical audiences.
Download the Padre source code and see how it does Wx Perl code, then steal rampantly from it's best tricks or maybe just gut it and use the application skeleton (using the Artistic half of the Perl dual license to make it legal).
Build your own Strawberry Perl subclass to package the application as an MSI installer and push it out across the corporate Active Directory domain.
Of course, I only say all this because you said "Dashboard" which I read as "Corporate", which then makes me assume a Microsoft AD network... | 0 | 1 | 0 | 1 | 2009-10-12T20:22:00.000 | 8 | 1 | false | 1,556,668 | 0 | 0 | 0 | 3 | We have a sizable code base in Perl. For the forseeable future, our codebase will remain in Perl. However, we're looking into adding a GUI-based dashboard utility. We are considering writing the dashboard in Python (using tkinter or wx). The problem, however, is that we would like to leverage our existing Perl codebase in the Python GUI.
So... any suggestions on how achieve this? We are considering a few options:
Write executables (in Perl) that mimic function calls; invoke those Perl executables in python as system calls.
Write Perl executables on-the-fly inside the Python dashboard, and invoke the (temporary) Perl executable.
Find some kind of Perl-to-Python converter or binding.
Any other ideas? I'd love to hear if other people have confronted this problem. Unfortunately, it's not an option to convert the codebase itself to Python at this time. |
Create a user-group in linux using python | 1,571,882 | 1 | 6 | 6,393 | 0 | python,linux,usergroups | There are no library calls for creating a group. This is because there's really no such thing as creating a group. A GID is simply a number assigned to a process or a file. All these numbers exist already - there is nothing you need to do to start using a GID. With the appropriate privileges, you can call chown(2) to set the GID of a file to any number, or setgid(2) to set the GID of the current process (there's a little more to it than that, with effective IDs, supplementary IDs, etc).
Giving a name to a GID is done by an entry in /etc/group on basic Unix/Linux/POSIX systems, but that's really just a convention adhered to by the Unix/Linux/POSIX userland tools. Other network-based directories also exist, as mentioned by Jack Lloyd.
The man page group(5) describes the format of the /etc/group file, but it is not recommended that you write to it directly. Your distribution will have policies on how unnamed GIDs are allocated, such as reserving certain spaces for different purposes (fixed system groups, dynamic system groups, user groups, etc). The range of these number spaces differs on different distributions. These policies are usually encoded in the command-line tools that a sysadmin uses to assign unnamed GIDs.
This means the best way to add a group locally is to use the command-line tools. | 0 | 1 | 0 | 0 | 2009-10-15T05:13:00.000 | 4 | 0.049958 | false | 1,570,401 | 0 | 0 | 0 | 3 | I want to create a user group using python on CentOS system. When I say 'using python' I mean I don't want to do something like os.system and give the unix command to create a new group. I would like to know if there is any python module that deals with this.
Searching on the net did not reveal much about what I want, except for python user groups.. so I had to ask this.
I learned about the grp module by searching here on SO, but couldn't find anything about creating a group.
EDIT: I dont know if I have to start a new question for this, but I would also like to know how to add (existing) users to the newly created group.
Any help appreciated.
Thank you. |
Create a user-group in linux using python | 1,570,429 | 5 | 6 | 6,393 | 0 | python,linux,usergroups | I think you should use the commandline programs from your program, a lot of care has gone into making sure that they don't break the groups file if something goes wrong.
However the file format is quite straight forward to write something yourself if you choose to go that way | 0 | 1 | 0 | 0 | 2009-10-15T05:13:00.000 | 4 | 0.244919 | false | 1,570,401 | 0 | 0 | 0 | 3 | I want to create a user group using python on CentOS system. When I say 'using python' I mean I don't want to do something like os.system and give the unix command to create a new group. I would like to know if there is any python module that deals with this.
Searching on the net did not reveal much about what I want, except for python user groups.. so I had to ask this.
I learned about the grp module by searching here on SO, but couldn't find anything about creating a group.
EDIT: I dont know if I have to start a new question for this, but I would also like to know how to add (existing) users to the newly created group.
Any help appreciated.
Thank you. |
Create a user-group in linux using python | 1,570,448 | 11 | 6 | 6,393 | 0 | python,linux,usergroups | I don't know of a python module to do it, but the /etc/group and /etc/gshadow format is pretty standard, so if you wanted you could just open the files, parse their current contents and then add the new group if necessary.
Before you go doing this, consider:
What happens if you try to add a group that already exists on the system
What happens when multiple instances of your program try to add a group at the same time
What happens to your code when an incompatible change is made to the group format a couple releases down the line
NIS, LDAP, Kerberos, ...
If you're not willing to deal with these kinds of problems, just use the subprocess module and run groupadd. It will be way less likely to break your customers machines.
Another thing you could do that would be less fragile than writing your own would be to wrap the code in groupadd.c (in the shadow package) in Python and do it that way. I don't see this buying you much versus just exec'ing it, though, and it would add more complexity and fragility to your build. | 0 | 1 | 0 | 0 | 2009-10-15T05:13:00.000 | 4 | 1.2 | true | 1,570,401 | 0 | 0 | 0 | 3 | I want to create a user group using python on CentOS system. When I say 'using python' I mean I don't want to do something like os.system and give the unix command to create a new group. I would like to know if there is any python module that deals with this.
Searching on the net did not reveal much about what I want, except for python user groups.. so I had to ask this.
I learned about the grp module by searching here on SO, but couldn't find anything about creating a group.
EDIT: I dont know if I have to start a new question for this, but I would also like to know how to add (existing) users to the newly created group.
Any help appreciated.
Thank you. |
Python - Twisted and Unit Tests | 1,580,776 | 4 | 19 | 5,134 | 0 | python,unit-testing,twisted | As others mentioned, you should be using Trial for unit tests in Twisted.
You also should be unit testing from the bottom up - that's what the "unit" in unit testing implies. Test your data and logic before you test your interface. For a HTTP interface, you should be calling processGET, processPOST, etc with a mock request, but you should only be doing this after you've tested what these methods are calling. Each test should assume that the units tested elsewhere are working as designed.
If you're speaking HTTP, or you need a running server or other state, you're probably making higher level tests such as functional or integration tests. This isn't a bad thing, but you might want to rephrase your question. | 0 | 1 | 0 | 1 | 2009-10-16T01:03:00.000 | 4 | 0.197375 | false | 1,575,966 | 0 | 0 | 0 | 1 | I'm writing unit tests for a portion of an application that runs as an HTTP server. The approach I have been trying to take is to import the module that contains the HTTP server, start it. Then, the unit tests will use urllib2 to connect, send data, and check the response.
Our HTTP server is using Twisted. One problem here is that I'm just not that familiar with Twisted :)
Now, I instantiate our HTTP server and start it in the setUp() method and then I stop it in the tearDown() method.
Problem is, Twisted doesn't appear to like this, and it will only run one unit test. After the first one, the reactor won't start anymore.
I've searched and searched and searched, and I just can't seem to find an answer that makes sense.
Am I taking the wrong approach entirely, or just missing something obvious? |
What are the use cases for non relational datastores? | 1,588,748 | 2 | 3 | 587 | 1 | python,google-app-engine,couchdb | Consider the situation where you have many entity types but few instances of each entity. In this case you will have many tables each with a few records so a relational approach is not suitable. | 0 | 1 | 0 | 0 | 2009-10-19T13:36:00.000 | 3 | 0.132549 | false | 1,588,708 | 0 | 0 | 1 | 2 | I'm looking at using CouchDB for one project and the GAE app engine datastore in the other. For relational stuff I tend to use postgres, although I much prefer an ORM.
Anyway, what use cases suit non relational datastores best? |
What are the use cases for non relational datastores? | 1,589,186 | 0 | 3 | 587 | 1 | python,google-app-engine,couchdb | In some cases that are simply nice. ZODB is a Python-only object database, that is so well-integrated with Python that you can simply forget that it's there. You don't have to bother about it, most of the time. | 0 | 1 | 0 | 0 | 2009-10-19T13:36:00.000 | 3 | 0 | false | 1,588,708 | 0 | 0 | 1 | 2 | I'm looking at using CouchDB for one project and the GAE app engine datastore in the other. For relational stuff I tend to use postgres, although I much prefer an ORM.
Anyway, what use cases suit non relational datastores best? |
Google App Engine compatibility layer | 4,219,064 | 0 | 6 | 702 | 0 | python,google-app-engine | If you develop with web2py your code will run GAE other architectures wihtout changes using any of the 10 supported relational databases. The compatibility layer covers database api (including blobs and listproperty), email, and fetching). | 0 | 1 | 0 | 0 | 2009-10-19T16:33:00.000 | 5 | 0 | false | 1,589,743 | 0 | 0 | 1 | 1 | I'm planning an application running on Google App Engine. The only worry I would have is portability. Or just the option to have the app run on a local, private cluster.
I expected an option for Google App Engine applications to run on other systems, a compatibility layer, to spring up. I could imagine a GAE compatible framework utilizing Amazon SimpleDB or CouchDB to offer near 100% compatibility, if needs be through an abstraction layer. I prefer Python though Java would be acceptable.
However, as far as I know, none such facility exists today. Am I mistaken and if so where could I find this Googe App Engine compatibility layer. If I'm not, the questions is "why"? Are there unforetold technical issues or is there just no demand from the market (which would potentially hint at low rates of GAE adoption).
Regards,
Iwan |
Scheduled tasks in Win32 | 1,591,169 | 1 | 1 | 3,296 | 0 | python,windows-xp,scheduled-tasks | At the risk of not answering your question, can I suggest that if what you have to run is important or even critical then Windows task-Scheduler is not the way to run it.
There are so many awful flows when using the task-scheduler. Lets just start with the obvious ones:
There is no logging. There is no way to investigate what happens when things go wrong. There's no way to distribute work across PCs. There's no fault-tolerance. It's Windows only and the interface is crappy.
If any of the above is a problem for you you need something a bit more sophisticated. My suggestion is that you try Hudson, a.k.a. Sun's continuous integration server.
In addition to all of the above it can do cron-style scheduling, with automatic expiry of logs. It can be set to jabber or email on failure and you can even make it auto diagnose what went wrong with your process if you can make it produce some XML output.
Please please, do not use Windows Scheduled tasks. There are many better things to use, and I speak from experience when I say that I never regretted dumping the built-in scheduler. | 0 | 1 | 0 | 0 | 2009-10-19T19:03:00.000 | 7 | 0.028564 | false | 1,590,474 | 0 | 0 | 0 | 4 | I have a Scheduled Task on a WinXP SP2 machine that is set up to run a python script:
Daily
Start time: 12:03 AM
Schedule task daily: every 1 day
Start date: some time in the past
Repeat task: every 5 minutes
Until: Duration 24 hours
Basically, i want the script to run every five minutes, for ever.
My problem is the task runs sometime after 23:47 every night (presumably after 23:55) and does not run after that. What am I doing wrong? Alternatively, is there a different method you can suggest other than using Windows scheduled tasks? |
Scheduled tasks in Win32 | 1,590,518 | 1 | 1 | 3,296 | 0 | python,windows-xp,scheduled-tasks | On the first pane (labeled "Task") do you have "Run only if logged on" unchecked and "Enabled (scheduled task runs at specified time" checked?
I've run python jobs via Windows scheduled task with settings very similar to what you show. | 0 | 1 | 0 | 0 | 2009-10-19T19:03:00.000 | 7 | 0.028564 | false | 1,590,474 | 0 | 0 | 0 | 4 | I have a Scheduled Task on a WinXP SP2 machine that is set up to run a python script:
Daily
Start time: 12:03 AM
Schedule task daily: every 1 day
Start date: some time in the past
Repeat task: every 5 minutes
Until: Duration 24 hours
Basically, i want the script to run every five minutes, for ever.
My problem is the task runs sometime after 23:47 every night (presumably after 23:55) and does not run after that. What am I doing wrong? Alternatively, is there a different method you can suggest other than using Windows scheduled tasks? |
Scheduled tasks in Win32 | 1,590,558 | 1 | 1 | 3,296 | 0 | python,windows-xp,scheduled-tasks | Also, for the past year or so I've seen a common bug where Scheduled Tasks on Server 2003 or XP do not run if either of the following checkboxes are on:
"Don't start the task if the computer is running on batteries"
"Stop the task if battery mode begins"
It seems that Windows gets a little confused if you have a battery (on a laptop) or a UPS (on a server, for example), whether or not your utility power is working.
Also, as a rule I would trim down the time or uncheck the option to "Stop the task if it runs for X minutes" when you're running it so often. | 0 | 1 | 0 | 0 | 2009-10-19T19:03:00.000 | 7 | 0.028564 | false | 1,590,474 | 0 | 0 | 0 | 4 | I have a Scheduled Task on a WinXP SP2 machine that is set up to run a python script:
Daily
Start time: 12:03 AM
Schedule task daily: every 1 day
Start date: some time in the past
Repeat task: every 5 minutes
Until: Duration 24 hours
Basically, i want the script to run every five minutes, for ever.
My problem is the task runs sometime after 23:47 every night (presumably after 23:55) and does not run after that. What am I doing wrong? Alternatively, is there a different method you can suggest other than using Windows scheduled tasks? |
Scheduled tasks in Win32 | 1,590,873 | 1 | 1 | 3,296 | 0 | python,windows-xp,scheduled-tasks | Until: Duration 24 hours
That shuts it off at the end of the first day.
Remove that, see if it keeps going. It should, and you shouldn't need to install Python in the process. :) | 0 | 1 | 0 | 0 | 2009-10-19T19:03:00.000 | 7 | 0.028564 | false | 1,590,474 | 0 | 0 | 0 | 4 | I have a Scheduled Task on a WinXP SP2 machine that is set up to run a python script:
Daily
Start time: 12:03 AM
Schedule task daily: every 1 day
Start date: some time in the past
Repeat task: every 5 minutes
Until: Duration 24 hours
Basically, i want the script to run every five minutes, for ever.
My problem is the task runs sometime after 23:47 every night (presumably after 23:55) and does not run after that. What am I doing wrong? Alternatively, is there a different method you can suggest other than using Windows scheduled tasks? |
Is there any simple way to benchmark Python script? | 5,544,739 | 12 | 105 | 101,454 | 0 | python,unix,shell,benchmarking | I usually do a quick time ./script.py to see how long it takes. That does not show you the memory though, at least not as a default. You can use /usr/bin/time -v ./script.py to get a lot of information, including memory usage. | 0 | 1 | 0 | 1 | 2009-10-20T07:40:00.000 | 12 | 1 | false | 1,593,019 | 1 | 0 | 0 | 1 | Usually I use shell command time. My purpose is to test if data is small, medium, large or very large set, how much time and memory usage will be.
Any tools for Linux or just Python to do this? |
Get the request uri outside of a RequestHandler in Google App Engine (Python) | 1,593,985 | 2 | 1 | 786 | 0 | python,google-app-engine | You should generally be doing everything within some sort of RequestHandler or the equivalent in your non-WebApp framework. However, if you really insist on being stuck in the early 1990s and writing plain CGI scripts, the environment variables SERVER_NAME and PATH_INFO may be what you want; see a CGI reference for more info. | 0 | 1 | 1 | 0 | 2009-10-20T09:33:00.000 | 2 | 1.2 | true | 1,593,483 | 0 | 0 | 1 | 1 | So, within a webapp.RequestHandler subclass I would use self.request.uri to get the request URI. But, I can't access this outside of a RequestHandler and so no go. Any ideas?
I'm running Python and I'm new at it as well as GAE. |
How to make a Python script run like a service or daemon in Linux | 8,956,634 | 11 | 213 | 365,270 | 0 | python,linux,scripting,daemons | how about using $nohup command on linux?
I use it for running my commands on my Bluehost server.
Please advice if I am wrong. | 0 | 1 | 0 | 1 | 2009-10-21T19:36:00.000 | 16 | 1 | false | 1,603,109 | 0 | 0 | 0 | 4 | I have written a Python script that checks a certain e-mail address and passes new e-mails to an external program. How can I get this script to execute 24/7, such as turning it into daemon or service in Linux. Would I also need a loop that never ends in the program, or can it be done by just having the code re executed multiple times? |
How to make a Python script run like a service or daemon in Linux | 35,008,431 | 7 | 213 | 365,270 | 0 | python,linux,scripting,daemons | If you are using terminal(ssh or something) and you want to keep a long-time script working after you log out from the terminal, you can try this:
screen
apt-get install screen
create a virtual terminal inside( namely abc): screen -dmS abc
now we connect to abc: screen -r abc
So, now we can run python script: python keep_sending_mails.py
from now on, you can directly close your terminal, however, the python script will keep running rather than being shut down
Since this keep_sending_mails.py's PID is a child process of the virtual screen rather than the
terminal(ssh)
If you want to go back check your script running status, you can use screen -r abc again | 0 | 1 | 0 | 1 | 2009-10-21T19:36:00.000 | 16 | 1 | false | 1,603,109 | 0 | 0 | 0 | 4 | I have written a Python script that checks a certain e-mail address and passes new e-mails to an external program. How can I get this script to execute 24/7, such as turning it into daemon or service in Linux. Would I also need a loop that never ends in the program, or can it be done by just having the code re executed multiple times? |
How to make a Python script run like a service or daemon in Linux | 20,908,406 | 1 | 213 | 365,270 | 0 | python,linux,scripting,daemons | Use whatever service manager your system offers - for example under Ubuntu use upstart. This will handle all the details for you such as start on boot, restart on crash, etc. | 0 | 1 | 0 | 1 | 2009-10-21T19:36:00.000 | 16 | 0.012499 | false | 1,603,109 | 0 | 0 | 0 | 4 | I have written a Python script that checks a certain e-mail address and passes new e-mails to an external program. How can I get this script to execute 24/7, such as turning it into daemon or service in Linux. Would I also need a loop that never ends in the program, or can it be done by just having the code re executed multiple times? |
How to make a Python script run like a service or daemon in Linux | 19,515,492 | 12 | 213 | 365,270 | 0 | python,linux,scripting,daemons | cron is clearly a great choice for many purposes. However it doesn't create a service or daemon as you requested in the OP. cron just runs jobs periodically (meaning the job starts and stops), and no more often than once / minute. There are issues with cron -- for example, if a prior instance of your script is still running the next time the cron schedule comes around and launches a new instance, is that OK? cron doesn't handle dependencies; it just tries to start a job when the schedule says to.
If you find a situation where you truly need a daemon (a process that never stops running), take a look at supervisord. It provides a simple way to wrapper a normal, non-daemonized script or program and make it operate like a daemon. This is a much better way than creating a native Python daemon. | 0 | 1 | 0 | 1 | 2009-10-21T19:36:00.000 | 16 | 1 | false | 1,603,109 | 0 | 0 | 0 | 4 | I have written a Python script that checks a certain e-mail address and passes new e-mails to an external program. How can I get this script to execute 24/7, such as turning it into daemon or service in Linux. Would I also need a loop that never ends in the program, or can it be done by just having the code re executed multiple times? |
kill subprocess when python process is killed? | 1,603,828 | 0 | 6 | 3,964 | 0 | python,windows,process | subprocess.Popen objects come with a kill and a terminate method (differs in which signal you send to the process).
signal.signal allows you install signal handlers, in which you can call the child's kill method. | 0 | 1 | 0 | 0 | 2009-10-21T21:08:00.000 | 3 | 0 | false | 1,603,658 | 0 | 0 | 0 | 1 | I am writing a python program that lauches a subprocess (using Popen).
I am reading stdout of the subprocess, doing some filtering, and writing to
stdout of main process.
When I kill the main process (cntl-C) the subprocess keeps running.
How do I kill the subprocess too? The subprocess is likey to run a long time.
Context:
I'm launching only one subprocess at a time, I'm filtering its stdout.
The user might decide to interrupt to try something else.
I'm new to python and I'm using windows, so please be gentle. |
Python debugging in Netbeans | 1,606,803 | 1 | 4 | 2,156 | 0 | python,netbeans | I just installed Python for NetBeans yesterday and hadn't tried the debugger, so just tried it, and I got the same error. So I thought maybe it's a Firewall issue, disabled my Firewall and retried it, and then it worked.
However I restarted the Firewall and now it's still working, so I don't know. I saw the Netbeans options for Python have an input to specify the beginning listening port (which mine was 29000 not 11111 like yours). | 0 | 1 | 0 | 0 | 2009-10-22T12:02:00.000 | 2 | 0.099668 | false | 1,606,746 | 0 | 0 | 1 | 2 | I have a problem with debugging Python programs under the Netbeans IDE. When I start debugging, the debugger writes the following log and error. Thank you for help.
[LOG]PythonDebugger : overall Starting
>>>[LOG]PythonDebugger.taskStarted : I am Starting a new Debugging Session ...
[LOG]This window is an interactive debugging context aware Python Shell
[LOG]where you can enter python console commands while debugging
>>>c:\documents and settings\aster\.netbeans\6.7\config\nbpython\debug\nbpythondebug\jpydaemon.py
args = ['C:\\Documents and Settings\\aster\\.netbeans\\6.7\\config\\nbPython\\debug\\nbpythondebug\\jpydaemon.py', 'localhost', '11111']
localDebuggee= None
JPyDbg connecting localhost on in= 11111 /out= 11112
ERROR:JPyDbg connection failed errno(10061) : Connection refused
Debug session normal end
ERROR :: Server Socket listen for debuggee has timed out (more than 20 seconds wait) java.net.SocketTimeoutException: Accept timed out
thanks for answer |
Python debugging in Netbeans | 1,636,617 | 1 | 4 | 2,156 | 0 | python,netbeans | For Python I like WingIDE from Wingware. | 0 | 1 | 0 | 0 | 2009-10-22T12:02:00.000 | 2 | 0.099668 | false | 1,606,746 | 0 | 0 | 1 | 2 | I have a problem with debugging Python programs under the Netbeans IDE. When I start debugging, the debugger writes the following log and error. Thank you for help.
[LOG]PythonDebugger : overall Starting
>>>[LOG]PythonDebugger.taskStarted : I am Starting a new Debugging Session ...
[LOG]This window is an interactive debugging context aware Python Shell
[LOG]where you can enter python console commands while debugging
>>>c:\documents and settings\aster\.netbeans\6.7\config\nbpython\debug\nbpythondebug\jpydaemon.py
args = ['C:\\Documents and Settings\\aster\\.netbeans\\6.7\\config\\nbPython\\debug\\nbpythondebug\\jpydaemon.py', 'localhost', '11111']
localDebuggee= None
JPyDbg connecting localhost on in= 11111 /out= 11112
ERROR:JPyDbg connection failed errno(10061) : Connection refused
Debug session normal end
ERROR :: Server Socket listen for debuggee has timed out (more than 20 seconds wait) java.net.SocketTimeoutException: Accept timed out
thanks for answer |
What profiling tools exist for Python on Linux beyond the ones included in the standard library? | 1,608,157 | 2 | 1 | 1,160 | 0 | python,linux,profiling | I'm not sure if python will provide the low level information you are looking for. You might want to look at oprofile and latencytop though. | 0 | 1 | 0 | 1 | 2009-10-22T14:29:00.000 | 2 | 0.197375 | false | 1,607,641 | 0 | 0 | 0 | 1 | I've been using Python's built-in cProfile tool with some pretty good success. But I'd like to be able to access more information such as how long I'm waiting for I/O (and what kind of I/O I'm waiting on) or how many cache misses I have. Are there any Linux tools to help with this beyond your basic time command? |
Run time of a subprocess.Popen instance | 1,608,884 | 1 | 1 | 1,488 | 0 | python,subprocess | No, but you can simply subclass and extend the Popen class to store the time it was created. | 0 | 1 | 0 | 0 | 2009-10-22T17:26:00.000 | 3 | 1.2 | true | 1,608,724 | 0 | 0 | 0 | 1 | Is there an easy way to find out the current (real or cpu) run time of a subprocess.Popen instance? |
Determine if a script is running in pythonw? | 1,611,558 | 5 | 2 | 1,325 | 0 | python,pythonw | sys.executable -- "A string giving the name of the executable binary for the Python interpreter, on systems where this makes sense." | 0 | 1 | 0 | 1 | 2009-10-23T05:31:00.000 | 1 | 1.2 | true | 1,611,543 | 0 | 0 | 0 | 1 | I would like to redirect stderr and stdout to files when run inside of pythonw. How can I determine whether a script is running in pythonw or in python? |
Running Python from the Windows Command Line | 1,615,021 | 5 | 1 | 15,004 | 0 | python,windows | If you don't want to install an IDE, you can also use IDLE which includes a Python editor and a console to test things out, this is part of the standard installation.
If you installed the python.org version, you will see an IDLE (Python GUI) in your start menu. I would recommend adding it to your Quick Launch or your desktop - whatever you are most familiar with. Then right-click on the shortcut you have created and change the "Start in" directory to your project directory or a place you can mess with, not the installation directory which is the default place and probably a bad idea.
When you double-click the shortcut it will launch IDLE, a console in which you can type in Python command and have history, completion, colours and so on. You can also start an editor to create a program file (like mentioned in the other posts). There is even a debugger.
If you saved your application in "test.py", you can start it from the editor itself. Or from the console with execfile("test.py"), import test (if that is a module), or finally from the debugger. | 0 | 1 | 0 | 0 | 2009-10-23T17:33:00.000 | 7 | 0.141893 | false | 1,614,898 | 1 | 0 | 0 | 4 | How do I run a Python file from the Windows Command Line (cmd.exe) so that I won't have to re-enter the code each time? |
Running Python from the Windows Command Line | 1,614,915 | 0 | 1 | 15,004 | 0 | python,windows | In DOS you can use edit to create/modify text files, then execute them by typing python [yourfile] | 0 | 1 | 0 | 0 | 2009-10-23T17:33:00.000 | 7 | 0 | false | 1,614,898 | 1 | 0 | 0 | 4 | How do I run a Python file from the Windows Command Line (cmd.exe) so that I won't have to re-enter the code each time? |
Running Python from the Windows Command Line | 1,614,908 | 2 | 1 | 15,004 | 0 | python,windows | If you put the Python executable (python.exe) on your path, you can invoke your script using python script.py where script.py is the Python file that you want to execute. | 0 | 1 | 0 | 0 | 2009-10-23T17:33:00.000 | 7 | 0.057081 | false | 1,614,898 | 1 | 0 | 0 | 4 | How do I run a Python file from the Windows Command Line (cmd.exe) so that I won't have to re-enter the code each time? |
Running Python from the Windows Command Line | 1,614,906 | 0 | 1 | 15,004 | 0 | python,windows | Open a command prompt, by pressing Win+R and writing cmd in that , navigate to the script directory , and write : python script.py | 0 | 1 | 0 | 0 | 2009-10-23T17:33:00.000 | 7 | 0 | false | 1,614,898 | 1 | 0 | 0 | 4 | How do I run a Python file from the Windows Command Line (cmd.exe) so that I won't have to re-enter the code each time? |
How to get duration of video flash file? | 1,617,438 | 3 | 2 | 1,706 | 0 | python,flash | One way it can be done using ffmpeg. ffmpeg needs to be installed with h.264 and h.263 codec support. Then following is the command to retrieve the video duration, which can be called via python system(command).
ffmpeg -i flv_file 2>&1 | grep "Duration" | cut -d ' ' -f 4 | sed s/,// | 0 | 1 | 0 | 0 | 2009-10-23T20:21:00.000 | 2 | 1.2 | true | 1,615,690 | 0 | 0 | 0 | 1 | On Linux, YouTube places temporary flash files in /tmp. Nautilus can display the duration (Minutes:Seconds) of them, but I haven't found a way to extract the duration using python.'
The fewer dependencies your method requires the better.
Thanks in advance. |
Generating Separate Output files in Hadoop Streaming | 1,664,639 | 1 | 9 | 4,270 | 0 | python,streaming,hadoop,mapreduce | Is it possible to replace the outputFormatClass, when using streaming?
In a native Java implementation you would extend the MultipleTextOutputFormat class and modify the method that names the output file. Then define your implementation as new outputformat with JobConf's setOutputFormat method
you should verify, if this is possible in streaming too. I donno :-/ | 0 | 1 | 0 | 0 | 2009-10-26T19:17:00.000 | 3 | 0.066568 | false | 1,626,786 | 0 | 0 | 0 | 1 | Using only a mapper (a Python script) and no reducer, how can I output a separate file with the key as the filename, for each line of output, rather than having long files of output? |
No IDLE for Python 3? | 19,543,322 | 3 | 6 | 12,340 | 0 | python,python-3.x,python-idle | Type 'idle3' in the terminal window. That should launch your copy of idle 3.1 | 0 | 1 | 0 | 0 | 2009-10-27T13:15:00.000 | 2 | 0.291313 | false | 1,630,728 | 1 | 0 | 0 | 1 | I installed Python 3.1 yesterday on my Windows Vista PC, and was surprised to find that the version of IDLE is 2.6.4, for "Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on win32"
I was hoping to use IDLE to investigate some of the new features of Python 3...
I guess I'm stuck with the command line...
Anyone know what's up with Python 3's IDLE?
Thanks |
How to permanently append a path to Python for Linux? | 1,641,426 | 11 | 4 | 1,063 | 0 | python | 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/ | 0 | 1 | 0 | 0 | 2009-10-29T03:11:00.000 | 2 | 1.2 | true | 1,641,418 | 1 | 0 | 0 | 2 | 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,641,468 | 1 | 4 | 1,063 | 0 | python | 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. | 0 | 1 | 0 | 0 | 2009-10-29T03:11:00.000 | 2 | 0.099668 | false | 1,641,418 | 1 | 0 | 0 | 2 | I know there are multiple solutions online, but some are for windows, some are environmental variable, etc..
What is the best way? |
Killing Python webservers | 1,643,387 | 1 | 1 | 410 | 0 | python | Raise exeption and handle it in main or use sys.exit | 0 | 1 | 0 | 1 | 2009-10-29T12:26:00.000 | 4 | 0.049958 | false | 1,643,362 | 0 | 0 | 0 | 1 | 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. |
Python on AIX: What are my options? | 1,646,337 | 4 | 6 | 13,755 | 0 | python,aix,ncurses,curses | I'd compile it from source myself and tell them where to download it from in the instructions | 0 | 1 | 0 | 0 | 2009-10-29T20:21:00.000 | 3 | 1.2 | true | 1,646,293 | 1 | 0 | 0 | 1 | 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. |
mod_python django logging problem | 1,648,183 | 2 | 1 | 556 | 0 | python,django,logging | 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. | 0 | 1 | 0 | 0 | 2009-10-30T04:10:00.000 | 1 | 1.2 | true | 1,647,974 | 0 | 0 | 1 | 1 | 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? |
Problem compiling Python 2.6.4 on AIX 5.3 | 9,372,135 | 1 | 0 | 2,579 | 0 | python,compilation,aix,ncurses | 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!!! | 0 | 1 | 0 | 0 | 2009-10-30T12:04:00.000 | 3 | 0.066568 | false | 1,649,412 | 0 | 0 | 0 | 2 | 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 | 1,661,609 | 0 | 0 | 2,579 | 0 | python,compilation,aix,ncurses | 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. | 0 | 1 | 0 | 0 | 2009-10-30T12:04:00.000 | 3 | 0 | false | 1,649,412 | 0 | 0 | 0 | 2 | 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. |
getting previously typed commands in python | 1,654,569 | 0 | 0 | 794 | 0 | shell,command,python-idle,python-2.5 | check if there is ipython available on windows .. that offers line history, tab completion and many other nice features | 0 | 1 | 0 | 0 | 2009-10-31T14:23:00.000 | 2 | 0 | false | 1,654,520 | 1 | 0 | 0 | 2 | 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,654,586 | 0 | 0 | 794 | 0 | shell,command,python-idle,python-2.5 | 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. | 0 | 1 | 0 | 0 | 2009-10-31T14:23:00.000 | 2 | 1.2 | true | 1,654,520 | 1 | 0 | 0 | 2 | 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. |
erlang on google app engine? | 1,654,786 | 11 | 2 | 1,713 | 0 | python,google-app-engine,erlang | 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. | 0 | 1 | 0 | 0 | 2009-10-31T15:48:00.000 | 1 | 1.2 | true | 1,654,759 | 0 | 0 | 1 | 1 | 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 ? |
Python: Monitoring and killing/throttling spawned processes based on load, time, etc | 2,246,627 | 1 | 4 | 2,059 | 0 | python | 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()
>>> | 0 | 1 | 0 | 0 | 2009-10-31T16:53:00.000 | 3 | 0.066568 | false | 1,654,922 | 0 | 0 | 0 | 1 | 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? |
Querying the connecting device for usb devices in OS X | 1,655,945 | 0 | 1 | 477 | 0 | python,macos,usb | 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. | 0 | 1 | 0 | 0 | 2009-10-31T23:34:00.000 | 1 | 0 | false | 1,655,927 | 0 | 0 | 0 | 1 | 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. |
module to abstract limitations of GQL | 1,660,404 | 1 | 0 | 78 | 1 | python,google-app-engine,gql | 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. | 0 | 1 | 0 | 0 | 2009-11-01T23:54:00.000 | 1 | 1.2 | true | 1,658,829 | 0 | 0 | 0 | 1 | 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 |
MacPython: programmatically finding all serial ports | 1,659,294 | 1 | 3 | 2,216 | 0 | python,macos,serial-port | 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. | 0 | 1 | 0 | 1 | 2009-11-02T03:16:00.000 | 2 | 0.099668 | false | 1,659,283 | 0 | 0 | 0 | 1 | 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. |
Running Python's IDLE in windows | 1,662,586 | 15 | 8 | 31,240 | 0 | python,windows,python-idle | 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. | 0 | 1 | 0 | 0 | 2009-11-02T17:22:00.000 | 2 | 1.2 | true | 1,662,576 | 1 | 0 | 0 | 2 | 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 | 12,381,743 | 2 | 8 | 31,240 | 0 | python,windows,python-idle | 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. | 0 | 1 | 0 | 0 | 2009-11-02T17:22:00.000 | 2 | 0.197375 | false | 1,662,576 | 1 | 0 | 0 | 2 | I messed up my IDLE shortcut. What is the way to start IDLE from the cmd.exe shell in Windows? |
How do I mount a filesystem using Python? | 1,667,268 | -15 | 44 | 62,081 | 0 | python,unix | 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. | 0 | 1 | 0 | 0 | 2009-11-03T13:10:00.000 | 10 | 1.2 | true | 1,667,257 | 0 | 0 | 0 | 4 | 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,667,358 | 11 | 44 | 62,081 | 0 | python,unix | Import cdll from ctypes. Then load your os libc, then use libc.mount()
Read libc's docs for mount parameters | 0 | 1 | 0 | 0 | 2009-11-03T13:10:00.000 | 10 | 1 | false | 1,667,257 | 0 | 0 | 0 | 4 | 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,667,328 | 0 | 44 | 62,081 | 0 | python,unix | 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. | 0 | 1 | 0 | 0 | 2009-11-03T13:10:00.000 | 10 | 0 | false | 1,667,257 | 0 | 0 | 0 | 4 | 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? | 6,963,468 | 3 | 44 | 62,081 | 0 | python,unix | 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). | 0 | 1 | 0 | 0 | 2009-11-03T13:10:00.000 | 10 | 0.059928 | false | 1,667,257 | 0 | 0 | 0 | 4 | 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 to process long-running requests in python workers? | 1,718,183 | 0 | 4 | 2,509 | 0 | python,nginx,load-balancing,wsgi,reverse-proxy | 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. | 0 | 1 | 1 | 1 | 2009-11-04T15:51:00.000 | 7 | 0 | false | 1,674,696 | 0 | 0 | 0 | 4 | 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? | 1,675,726 | 0 | 4 | 2,509 | 0 | python,nginx,load-balancing,wsgi,reverse-proxy | 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. | 0 | 1 | 1 | 1 | 2009-11-04T15:51:00.000 | 7 | 0 | false | 1,674,696 | 0 | 0 | 0 | 4 | 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? | 1,682,864 | 1 | 4 | 2,509 | 0 | python,nginx,load-balancing,wsgi,reverse-proxy | 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. | 0 | 1 | 1 | 1 | 2009-11-04T15:51:00.000 | 7 | 0.028564 | false | 1,674,696 | 0 | 0 | 0 | 4 | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.