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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
How to debug python scripts that fork | 23,942,909 | 0 | 5 | 2,992 | 0 | python,debugging,fork | One possible way to debug a fork is to use pdb on the main process and winpdb on the fork. You put a software break early in the fork process and attach the winpdb app once the break has been hit.
It might be possible to run the program under winpdb and attach another instance after the fork - I haven't tried this. You... | 0 | 1 | 0 | 1 | 2011-09-01T09:39:00.000 | 5 | 0 | false | 7,268,563 | 0 | 0 | 0 | 4 | In perl debugger I can use DB::get_fork_TTY() to debug both parent and child process in different terminals. Is there anything similar in python debugger?
Or, is there any good way to debug fork in python? |
How to debug python scripts that fork | 7,268,624 | 3 | 5 | 2,992 | 0 | python,debugging,fork | You can emulate forked process if you will set instead of fork and its condition (pid == 0) always True. For debugging main process debugger will work.
For debugging multi-processing interaction better to use detailed logs as for me | 0 | 1 | 0 | 1 | 2011-09-01T09:39:00.000 | 5 | 1.2 | true | 7,268,563 | 0 | 0 | 0 | 4 | In perl debugger I can use DB::get_fork_TTY() to debug both parent and child process in different terminals. Is there anything similar in python debugger?
Or, is there any good way to debug fork in python? |
Logger Entity in App engine | 7,342,091 | 1 | 2 | 157 | 0 | python,google-app-engine,nosql,google-cloud-datastore | There are a few ways to do this:
Accumulate logs and write them in a single datastore put at the end of the request. This is the highest latency option, but only slightly - datastore puts are fairly fast. This solution also consumes the least resources of all the options.
Accumulate logs and enqueue a task queue task ... | 0 | 1 | 0 | 0 | 2011-09-01T17:24:00.000 | 2 | 1.2 | true | 7,274,049 | 0 | 0 | 1 | 2 | Is it viable to have a logger entity in app engine for writing logs? I'll have an app with ~1500req/sec and am thinking about doing it with a taskqueue. Whenever I receive a request, I would create a task and put it in a queue to write something to a log entity (with a date and string properties).
I need this because ... |
Logger Entity in App engine | 7,332,700 | 0 | 2 | 157 | 0 | python,google-app-engine,nosql,google-cloud-datastore | How about keeping a memcache data structure of request info (recorded as they arrive) and then run an every 5 minute (or faster) cron job that crunches the stats on the last 5 minutes of requests from the memcache and just records those stats in the data store for that 5 minute interval. The same (or a different) cron ... | 0 | 1 | 0 | 0 | 2011-09-01T17:24:00.000 | 2 | 0 | false | 7,274,049 | 0 | 0 | 1 | 2 | Is it viable to have a logger entity in app engine for writing logs? I'll have an app with ~1500req/sec and am thinking about doing it with a taskqueue. Whenever I receive a request, I would create a task and put it in a queue to write something to a log entity (with a date and string properties).
I need this because ... |
Make running python script more responsive to ctrl c? | 7,285,945 | 2 | 1 | 200 | 0 | python | Rather than using blocking calls with long timeouts, use event-driven networking. This will allow you never to have long periods of time doing uninterruptable operations. | 0 | 1 | 0 | 1 | 2011-09-02T15:39:00.000 | 2 | 1.2 | true | 7,285,874 | 0 | 0 | 0 | 1 | We are running a very large framework of python scripts for test automation and I do really miss the opportunity to kill a running python script with ctrl + c in some situations on Windows.
When the script might be doing some socket communications with long time-outs the only options sometimes is to kill the DOS window... |
How to tell whether sys.stdout has been flushed in Python | 7,310,072 | 1 | 5 | 431 | 0 | python,io,stdout | The answer is: you cannot tell (not without serious uglyness, an external C module or similar).
The reason is that python’s file-implementation is based on the C (stdio) implementation for FILE *. So an underlying python file object basically just has a reference to the opened FILE. When writing data the C-implementati... | 0 | 1 | 0 | 0 | 2011-09-04T22:12:00.000 | 1 | 1.2 | true | 7,302,450 | 1 | 0 | 0 | 1 | I'm trying to debug some code I wrote, which involves a lot of parallel processes. And have some unwanted behaviour involving output to sys.stdout and certain messages being printed twice. For debugging purposes it would be very useful to know whether at a certain point sys.stdout has been flushed or not. I wonder if t... |
Redirecting one directory to another | 7,305,485 | 0 | 1 | 106 | 0 | python,windows,directory | Why don't you have the folder(s) zipped & unzip the folder when ever the game loads (into temp folder), from there things would be simpler. since the data is in temp, you can delete the information when the program exits or let windows clean it up.
this suggestion would work if the folder size is relatively small (a f... | 0 | 1 | 0 | 0 | 2011-09-05T08:16:00.000 | 2 | 0 | false | 7,305,455 | 1 | 0 | 0 | 2 | I am working on a mod script in Python for a legacy game. This game looks for the folder "AI" in its installation directory. Now, everytime before the game runs, a certain folder is chosen (say, AI_1 or AI_2), which should behave as if it is the AI folder (the actual AI folder doesn't exist).
I thought of a few solutio... |
Redirecting one directory to another | 7,305,874 | 0 | 1 | 106 | 0 | python,windows,directory | I think that option with renaming is fine. To workaround a situation when scrip is terminated unexpectedly put an additional file with original folder name to all of the AI_x folders. Then on startup just check this file in AI folder and rename the folder back to its original name.
Another variant is to add only one fi... | 0 | 1 | 0 | 0 | 2011-09-05T08:16:00.000 | 2 | 1.2 | true | 7,305,455 | 1 | 0 | 0 | 2 | I am working on a mod script in Python for a legacy game. This game looks for the folder "AI" in its installation directory. Now, everytime before the game runs, a certain folder is chosen (say, AI_1 or AI_2), which should behave as if it is the AI folder (the actual AI folder doesn't exist).
I thought of a few solutio... |
Python communicate with a subprocess | 7,316,014 | 2 | 2 | 1,058 | 0 | python,streaming,subprocess,producer-consumer | Well I am new to python, but it seems proc.communicate or proc.stdout.readline/readlines waits till the process has completed.
As per my knowledge, you can implement a rotational logging and redirect output to a file, then using subprocess you can fire tailf -n XX logfile, in a loop until the program ends, and print th... | 0 | 1 | 0 | 0 | 2011-09-06T05:13:00.000 | 3 | 0.132549 | false | 7,315,212 | 0 | 0 | 0 | 1 | I have a subprocess which is constantly producing data, but most of the data I'm not interested in. However occasionally, at random times, I need to grab a sample of the output - the thing is I need to read it at well defined boundaries. For example, let's assume the process produces a constant 100 bytes per second a... |
Referencing an external library in a Python appengine project, using Pydev/Eclipse | 7,329,481 | 4 | 5 | 979 | 0 | python,google-app-engine,pydev | The dev_appserver and the production environment don't have any concept of projects or libraries, so you need to structure your app so that all the necessary libraries are under the application's root. The easiest way to do this, usually, is to symlink them in as subdirectories, or worst-case, to copy them (or, using v... | 0 | 1 | 0 | 0 | 2011-09-07T04:46:00.000 | 1 | 1.2 | true | 7,328,959 | 0 | 0 | 1 | 1 | it's a couple of months I've started development in Python - having myself a C# and Java background.
I'm currently working on 2 different python/appengine applications, and as often happens in those cases, both application share common code - so I would like to refactor and move the common/generic code into a shared pl... |
running really long scripts - how to keep them running and start them again if they fail? | 7,334,651 | 3 | 1 | 137 | 0 | php,python,process,centos,process-management | is there any way to keep these processes running in such a way that all the variables are saved and i can restart the script from where it stopped?
Yes. It's called creating a "checkpoint" or "memento".
i know i can program this
Good. Get started. Each problem is unique, so you have to create, save, and reload t... | 0 | 1 | 0 | 1 | 2011-09-07T13:23:00.000 | 1 | 0.53705 | false | 7,334,587 | 0 | 0 | 0 | 1 | I need to run a bunch of long running processes on a CENTOS server.
If I leave the processes (python/php scripts) to run sometimes the processes will stop running because of trivial errors eg. string encoding issues or sometimes because the process seems to get killed by the server.
I try to use nohup and fire the jobs... |
Installing and including envisage plugin | 7,345,262 | 1 | 0 | 147 | 0 | python,plugins | I don't have access to the Envisage plugins documentation, so I'm not sure how these are installed. In general what you need to do is open Windows -> Preferences -> PyDev -> Interpreter - Python and check that the package directory is present in the System PYTHONPATH window. If it isn't add it and press Apply.
If your ... | 0 | 1 | 0 | 0 | 2011-09-08T07:53:00.000 | 1 | 1.2 | true | 7,344,835 | 1 | 0 | 0 | 1 | I just installed the envisagecore and envisageplugin in Ubuntu 10.04. I'm using Eclipse SDK and PyDev plugin. How can I import this plugin in Eclipse? |
Python: how to launch scp with pexpect without OpenSSH GUI Password Prompt on Ubuntu? | 7,353,518 | 1 | 1 | 905 | 0 | python,pexpect | See the DISPLAY and SSH_ASKPASS section of man ssh-add. | 0 | 1 | 0 | 1 | 2011-09-08T17:19:00.000 | 1 | 1.2 | true | 7,352,021 | 0 | 0 | 0 | 1 | I'm attempting to automate scp commands with pexpect on Ubuntu. However, I keep getting a password GUI prompt with title "OpenSSH". How can I disable this behavior and use command line prompts instead? |
Open a file as superuser in python | 7,354,922 | 4 | 5 | 11,540 | 0 | python,file-io | What you're looking for is called privilege escalation, and it very much depends on the platform you're running on. In general, what your program would have to do is run a portion as the superuser. On unix systems, for instance, you might be able to use sudo to read the contents of the file.
But as mentioned, this rea... | 0 | 1 | 0 | 0 | 2011-09-08T21:37:00.000 | 4 | 0.197375 | false | 7,354,834 | 1 | 0 | 0 | 2 | I have to open a system file and read from it. This file is usually only readable by root (the super user). I have a way to ask the user for the superuser password. I would like to use this credentials to open the file and read from it without having my entire program running as a superuser process. Is there a way to a... |
Open a file as superuser in python | 7,355,410 | 3 | 5 | 11,540 | 0 | python,file-io | I would split the program in two.
Handles opening the file and accessing the contents. It can assume it's started with the privileges it needs.
Everything else that doesn't require special privileges.
Put a config entry which describes how to exec or subprocess the command that requires extra privileges. ie.
acces... | 0 | 1 | 0 | 0 | 2011-09-08T21:37:00.000 | 4 | 0.148885 | false | 7,354,834 | 1 | 0 | 0 | 2 | I have to open a system file and read from it. This file is usually only readable by root (the super user). I have a way to ask the user for the superuser password. I would like to use this credentials to open the file and read from it without having my entire program running as a superuser process. Is there a way to a... |
Python raw_input() limit with Mac OS X Terminal? | 53,871,077 | 11 | 7 | 2,834 | 0 | python,macos,terminal | I had this same experience, and found python limits the length of input to raw_input if you do not import the readline module. Once I imported the readline module, it lifted the limit (or at least raised it significantly enough to where the text I was using worked just fine). | 0 | 1 | 0 | 0 | 2011-09-09T03:55:00.000 | 2 | 1 | false | 7,357,007 | 0 | 0 | 0 | 2 | I wrote a python script and have been running it in terminal on Mac OS X snow leopard using python2.6. I used raw_input() to import text in several places, but I seem to reach a limit where it will no longer accept any more characters.
Is this a limit in python raw_input() or is this something to do with Terminal or Ma... |
Python raw_input() limit with Mac OS X Terminal? | 7,357,025 | 4 | 7 | 2,834 | 0 | python,macos,terminal | I'd say it's a limitation/bug with the OSX Terminal - try running the script with input via IDLE and see whether you still hit the same problem.
As for better ways of dealing with large input - it totally depends on your requirements but some ways could be:
Import text from a file
Create some kind of GUI/frontend to h... | 0 | 1 | 0 | 0 | 2011-09-09T03:55:00.000 | 2 | 1.2 | true | 7,357,007 | 0 | 0 | 0 | 2 | I wrote a python script and have been running it in terminal on Mac OS X snow leopard using python2.6. I used raw_input() to import text in several places, but I seem to reach a limit where it will no longer accept any more characters.
Is this a limit in python raw_input() or is this something to do with Terminal or Ma... |
error when running "Check for updates" | 7,419,393 | 0 | 0 | 93 | 0 | python,aptana | Looks like that filepath is set up as an update site in your preferences. I'd just remove it, since it looks invalid (maybe you installed a pydev zip from here?). Go to Preferences > Install/Update > Available Software Sites and then remove the entry for it. | 0 | 1 | 0 | 1 | 2011-09-09T22:56:00.000 | 1 | 0 | false | 7,368,288 | 0 | 0 | 0 | 1 | I am running Aptana Studio 3, build: 3.0.4.201108101506.
When I run "Check for updates" I get the following error
"A Problem occurred"
No repository found at file:/C:/Users/Keith/AppData/Local/Aptana%20Studio%203/plugins/com.python.pydev_2.2.1.2011073123/.
Any help would be appreciated |
os.system('exit') in python | 7,368,546 | 1 | 2 | 10,910 | 0 | python,process,terminal,exit,terminate | Remember that system first spawns/forks a sub-shell to execute its commands. In effect, you are asking only the sub-shell to exit. | 0 | 1 | 0 | 0 | 2011-09-09T23:34:00.000 | 3 | 0.066568 | false | 7,368,523 | 0 | 0 | 0 | 2 | My friend is in a macOS environment and he wanted to call os.system('exit') at the end of his python script to make the terminal close. It doesn't. This doesn't surprise me but I would like to know what exactly is going on between the python script and the terminal when this call is made.
In my mental simulation the te... |
os.system('exit') in python | 7,368,553 | 2 | 2 | 10,910 | 0 | python,process,terminal,exit,terminate | The system function starts another shell to execute a command. So in this case your Python scripts starts a shell and runs "exit" command in there, which makes that process exit. However, the Python script itself, including a terminal where it is running, continues to run. If the intent is to kill the terminal, you hav... | 0 | 1 | 0 | 0 | 2011-09-09T23:34:00.000 | 3 | 0.132549 | false | 7,368,523 | 0 | 0 | 0 | 2 | My friend is in a macOS environment and he wanted to call os.system('exit') at the end of his python script to make the terminal close. It doesn't. This doesn't surprise me but I would like to know what exactly is going on between the python script and the terminal when this call is made.
In my mental simulation the te... |
Installing packages from source into EPD Python on Mac OS X | 7,372,654 | 0 | 0 | 791 | 0 | python,macos,import | Workaround: Decided to simply add a .pth file to my site-packages directory which points to /usr/local/lib/python2.7/dist-packages
That is: Place in /Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages
a file shogun.pth which simply contains: /usr/local/lib/python2.7/dist-packages/ | 0 | 1 | 0 | 0 | 2011-09-10T02:42:00.000 | 2 | 0 | false | 7,369,271 | 1 | 0 | 0 | 1 | I recently compiled the shogun library from source, but I'm not sure where I need to place the python files created. make install placed them in '/usr/local/lib/python2.7/dist-packages' which I assume is valid on linux systems.
sys.path in python doesn't have a dist-packages in its path, only a site-packages |
Effective way to find total number of files in a directory | 7,372,533 | 1 | 3 | 362 | 0 | python,linux,algorithm,archlinux | @shadyabhi: if you have many subdirectories maybe you can speedup the process by using os.listdir and multiprocessing.Process to recurse into each folder. | 0 | 1 | 0 | 1 | 2011-09-10T13:05:00.000 | 2 | 0.099668 | false | 7,371,878 | 0 | 0 | 0 | 2 | I am building a Music file organizer(in python2) in which I read the metadata of all files & then put those file in the required folder.
Now, I am already ready with the command line interface but this script shows feedback in a way that it shows "Which file is it working on right now?".
If the directory contains say 5... |
Effective way to find total number of files in a directory | 7,371,922 | 2 | 3 | 362 | 0 | python,linux,algorithm,archlinux | I'm sorry to say this but no there isn't any way to do it more efficiently than recursively finding the files (at least that is platform (or filesystem) independent).
If the filesystem can help you it will, and you can't do anything to help it.
The reason it's not possible to do it without recursive scanning is how the... | 0 | 1 | 0 | 1 | 2011-09-10T13:05:00.000 | 2 | 1.2 | true | 7,371,878 | 0 | 0 | 0 | 2 | I am building a Music file organizer(in python2) in which I read the metadata of all files & then put those file in the required folder.
Now, I am already ready with the command line interface but this script shows feedback in a way that it shows "Which file is it working on right now?".
If the directory contains say 5... |
PHP exec() command wont launch python script using sendkeys | 7,380,933 | 0 | 2 | 1,377 | 0 | php,python,windows,apache,exec | Figured it out thanks to the excellent help from Winston Ewert and Gringo Suave.
I set Apache's service to the Local System Account and gave it access to interact with the desktop. This should help if you have Windows XP or Server 2003, but Vista and newer there's an Interactive Services Detection that pops up when yo... | 0 | 1 | 0 | 1 | 2011-09-11T02:20:00.000 | 2 | 0 | false | 7,375,924 | 0 | 0 | 0 | 1 | First Note: Sorry this is long. Wanted to be thorough.
I really hate to ask a question when there's so much out there online but its been a week of searching and I have nothing to show for it. I'd really appreciate some help. I am a noob but I learn very fast and am more than willing to try alternate languages or whate... |
Does Python's read() always return requested size except at EOF? | 7,383,480 | 1 | 2 | 974 | 0 | python,file-io | On CPython, it will always return the number of bytes requested, unless EOF is reached. | 0 | 1 | 0 | 0 | 2011-09-12T04:59:00.000 | 2 | 1.2 | true | 7,383,464 | 1 | 0 | 0 | 2 | Does the Python read() method behave like C's read? Might it return less than the requested number of bytes before the last chunk of the file is reached? Or does it guarantee to always return the full amount of bytes when those bytes exist to be read? |
Does Python's read() always return requested size except at EOF? | 7,384,163 | 3 | 2 | 974 | 0 | python,file-io | Well, the Python Standard library says this about file.read([size]):
Read at most size bytes from the file (less if the read hits EOF before obtaining size bytes). If the size argument is negative or omitted, read all data until EOF is reached. ... An empty string is returned when EOF is encountered immediately. ... Al... | 0 | 1 | 0 | 0 | 2011-09-12T04:59:00.000 | 2 | 0.291313 | false | 7,383,464 | 1 | 0 | 0 | 2 | Does the Python read() method behave like C's read? Might it return less than the requested number of bytes before the last chunk of the file is reached? Or does it guarantee to always return the full amount of bytes when those bytes exist to be read? |
Fastest/most efficient in App Engine, local file read or memcache hit? | 7,400,621 | 6 | 5 | 478 | 0 | python,performance,google-app-engine | If they are just few kbytes I would load them on the instance memory; amongst the storage choices (Memcache, Datastore, Blobstore and so on) on Google App Engine , instance memory option shoud be the fastest. | 0 | 1 | 0 | 0 | 2011-09-13T09:58:00.000 | 1 | 1.2 | true | 7,399,965 | 0 | 0 | 1 | 1 | I have a couple of smaller asset files (text templates typically 100 - a few K bytes) in my app that I'm considering caching using memcached. But does anyone here know if loading a local file or requesting it from memcache is the fastest/most resource efficient?
(I'll be using the Python version of App Engine) |
Python command to create no-arch rpm's | 7,531,272 | 1 | 0 | 116 | 0 | python,rpm,distutils | If your software does not contain extension modules (modules written in C/C++), distutils will make the RPM noarch. I don’t think there’s a way to explicitly control it. | 0 | 1 | 0 | 1 | 2011-09-13T10:08:00.000 | 1 | 0.197375 | false | 7,400,099 | 0 | 0 | 0 | 1 | I am creating rpm's for my project which is in pure python. I am running the command
python setup.py bdist_rpm
to build the rpm. This is creating architechture specific rpm's (x86 or x86-64). What I would like is to have a no-arch rpm. Can any of python guru's help me with creating a no-arch rpm. Any help would be ap... |
What's the best pattern to design an asynchronous RPC application using Python, Pika and AMQP? | 10,063,487 | 0 | 9 | 5,996 | 0 | python,design-patterns,rabbitmq,amqp,pika | Your setup sounds good to me. And you are right, you can simply set the callback to start a thread and chain that to a separate callback when the thread finishes to queue the response back over Channel B.
Basically, your consumers should have a queue of their own (size of N, amount of parallelism they support). When a ... | 0 | 1 | 0 | 0 | 2011-09-13T14:32:00.000 | 3 | 0 | false | 7,403,585 | 0 | 0 | 0 | 2 | The producer module of my application is run by users who want to submit work to be done on a small cluster. It sends the subscriptions in JSON form through the RabbitMQ message broker.
I have tried several strategies, and the best so far is the following, which is still not fully working:
Each cluster machine runs a c... |
What's the best pattern to design an asynchronous RPC application using Python, Pika and AMQP? | 15,245,534 | 0 | 9 | 5,996 | 0 | python,design-patterns,rabbitmq,amqp,pika | Being unexperienced in threading, my setup would run multiple consumer processes (the number of which basically being your prefetch count). Each would connect to the two queues and they would process jobs happily, unknowning of eachother's existence. | 0 | 1 | 0 | 0 | 2011-09-13T14:32:00.000 | 3 | 0 | false | 7,403,585 | 0 | 0 | 0 | 2 | The producer module of my application is run by users who want to submit work to be done on a small cluster. It sends the subscriptions in JSON form through the RabbitMQ message broker.
I have tried several strategies, and the best so far is the following, which is still not fully working:
Each cluster machine runs a c... |
How to test server behavior under network loss at every possible packet | 7,424,772 | 2 | 3 | 435 | 0 | python,http,tcp,network-programming,scapy | Unless your application is actually responding to and generating its own IP packets (which would be incredibly silly), you probably don't need to do testing at that layer. Simply testing at the TCP layer (e.g, connect(), send(), recv(), shutdown()) will probably be sufficient, as those events are the only ones which yo... | 0 | 1 | 1 | 0 | 2011-09-14T23:54:00.000 | 1 | 1.2 | true | 7,424,349 | 0 | 0 | 0 | 1 | I'm working with mobile, so I expect network loss to be common. I'm doing payments, so each request matters.
I would like to be able to test my server to see precisely how it will behave with client network loss at different points in the request cycle -- specifically between any given packet send/receive during the en... |
How to install Python module on Ubuntu | 7,429,157 | 24 | 14 | 44,972 | 0 | python,python-module | Most installation requires:
sudo python setup.py install
Otherwise, you won't be able to write to the installation directories.
I'm pretty sure that (unless you were root), you got an error when you did
python2.7 setup.py install | 0 | 1 | 0 | 1 | 2011-09-15T06:23:00.000 | 2 | 1.2 | true | 7,426,677 | 1 | 0 | 0 | 1 | I just wrote a function on Python. Then, I wanted to make it module and install on my Ubuntu 11.04. Here is what I did.
Created setup.py along with function.py file.
Built distribution file using $Python2.7 setup.py sdist
Then installed it $Python2.7 setup.py install
All was going fine. But, later I wanted to use the... |
emacs switch from Shell to gdb or pdb mode | 7,438,162 | 0 | 3 | 453 | 0 | c++,python,emacs,gdb | If all you're looking for is source code line tracking, my emacs does pdb source line tracking in M-x shell buffers just fine. No need to enable any other mode. | 0 | 1 | 0 | 0 | 2011-09-15T17:59:00.000 | 1 | 0 | false | 7,435,366 | 0 | 0 | 0 | 1 | Let's say I have an open gdb or pdb session in an emacs shell. So the major mode is "Shell:run" Now I want to convert that buffer to gdb or pdb (python debugger) major mode.
I tried M-X gud-mode and that switched the mode to "Debugger:run". But it does not actually work; for example when I type "up", "down", or "n" ... |
Get input file name in streaming hadoop program | 24,434,211 | 0 | 7 | 9,150 | 0 | python,input,streaming,hadoop,filesplitting | The new ENV_VARIABLE for Hadoop 2.x is MAPREDUCE_MAP_INPUT_FILE | 0 | 1 | 0 | 0 | 2011-09-16T19:59:00.000 | 3 | 0 | false | 7,449,756 | 0 | 0 | 0 | 2 | I am able to find the name if the input file in a mapper class using FileSplit when writing the program in Java.
Is there a corresponding way to do this when I write a program in Python (using streaming?)
I found the following in the hadoop streaming document on apache:
See Configured Parameters. During the execution ... |
Get input file name in streaming hadoop program | 24,906,345 | 6 | 7 | 9,150 | 0 | python,input,streaming,hadoop,filesplitting | By parsing the mapreduce_map_input_file(new) or map_input_file(deprecated) environment variable, you will get the map input file name.
Notice:
The two environment variables are case-sensitive, all letters are lower-case. | 0 | 1 | 0 | 0 | 2011-09-16T19:59:00.000 | 3 | 1 | false | 7,449,756 | 0 | 0 | 0 | 2 | I am able to find the name if the input file in a mapper class using FileSplit when writing the program in Java.
Is there a corresponding way to do this when I write a program in Python (using streaming?)
I found the following in the hadoop streaming document on apache:
See Configured Parameters. During the execution ... |
virtual environment from Mac to Linux | 7,450,904 | 3 | 2 | 2,982 | 0 | python,django,linux,macos,virtualenv | You can just recreate the virtual environment on Ubuntu. The virtual env will have the python binary which will be different on a different system. | 0 | 1 | 0 | 0 | 2011-09-16T22:01:00.000 | 2 | 1.2 | true | 7,450,835 | 1 | 0 | 1 | 1 | I recently made a django project using virtualenv on my mac. That mac broke, but I saved the files and now I want to work on my project using my linux computer. I am now having some difficulty running the virtual environment in Ubuntu.
Does it even make sense to try and use a virtual env made in Mac OS on Ubuntu?
Than... |
GAE Lookup Table Incompatible with Transactions? | 7,466,485 | 1 | 0 | 143 | 1 | python,google-app-engine,transactions,google-cloud-datastore,entity-groups | If you can, try and fit the data into instance memory. If it won't fit in instance memory, you have a few options available to you.
You can store the data in a resource file that you upload with the app, if it only changes infrequently, and access it off disk. This assumes you can build a data structure that permits ea... | 0 | 1 | 0 | 0 | 2011-09-16T22:55:00.000 | 2 | 1.2 | true | 7,451,163 | 0 | 0 | 1 | 2 | My Python High Replication Datastore application requires a large lookup table of between 100,000 and 1,000,000 entries. I need to be able to supply a code to some method that will return the value associated with that code (or None if there is no association). For example, if my table held acceptable English words the... |
GAE Lookup Table Incompatible with Transactions? | 7,452,303 | 1 | 0 | 143 | 1 | python,google-app-engine,transactions,google-cloud-datastore,entity-groups | First, if you're under the belief that a namespace is going to help avoid key collisions, it's time to take a step back. A key consists of an entity kind, a namespace, a name or id, and any parents that the entity might have. It's perfectly valid for two different entity kinds to have the same name or id. So if you hav... | 0 | 1 | 0 | 0 | 2011-09-16T22:55:00.000 | 2 | 0.099668 | false | 7,451,163 | 0 | 0 | 1 | 2 | My Python High Replication Datastore application requires a large lookup table of between 100,000 and 1,000,000 entries. I need to be able to supply a code to some method that will return the value associated with that code (or None if there is no association). For example, if my table held acceptable English words the... |
Lock down a program so it has no access to outside files, like a virus scanner does | 7,466,568 | 0 | 0 | 189 | 0 | python,windows,linux,macos,permissions | You can run untrusted apps in chroot and block them from using network with an iptables rule (for example, owner --uid-owner match)
But really, virtual machine is more reliable and on modern hardware performance impact is negligible. | 0 | 1 | 0 | 0 | 2011-09-18T09:24:00.000 | 3 | 0 | false | 7,460,592 | 0 | 0 | 0 | 1 | I would like to launch an untrusted application programmatically, so I want to remove the program's ability to access files, network, etc. Essentially, I want to restrict it so its only interface to the rest of the computer is stdin and stdout.
Can I do that? Preferably in a cross-platform way but I sort of expect to h... |
Store images temporary in Google App Engine? | 7,461,775 | 4 | 2 | 424 | 0 | python,google-app-engine,hosting | GAE has a BlobStore API, which can work pretty much as a file storage, but probably it's not what you whant. Actually, the right answer depends on what kind of API you're using - it may support file-like objects, so you could pass urllib response object, or accept URLs, or tons of other interesting features | 0 | 1 | 0 | 0 | 2011-09-18T11:18:00.000 | 2 | 1.2 | true | 7,461,111 | 0 | 0 | 1 | 2 | I'm writing an app with Python, which will check for updates on a website(let's call it A) every 2 hours, if there are new posts, it will download the images in the post and post them to another website(call it B), then delete those images.
Site B provide API for upload images with description, which is like:
upload(im... |
Store images temporary in Google App Engine? | 7,465,743 | 1 | 2 | 424 | 0 | python,google-app-engine,hosting | You shouldn't need to use temporary storage at all - just download the image with urlfetch into memory, then use another urlfetch to upload it to the destination site. | 0 | 1 | 0 | 0 | 2011-09-18T11:18:00.000 | 2 | 0.099668 | false | 7,461,111 | 0 | 0 | 1 | 2 | I'm writing an app with Python, which will check for updates on a website(let's call it A) every 2 hours, if there are new posts, it will download the images in the post and post them to another website(call it B), then delete those images.
Site B provide API for upload images with description, which is like:
upload(im... |
Distributing python on Mac, Linux, and Windows using cx_freeze: can I generate all apps from one platform? | 7,474,129 | 6 | 7 | 993 | 0 | python,python-3.x,cx-freeze | Short answer: no
I've been doing something similiar recently (using cx_Freeze with Python 3). If you set up Python inside Wine, you can generate a Windows build, but I had to copy some DLLs in before it worked properly (cx_Freeze calls a Windows API function that's not implemented in Wine). I've not run into any way of... | 0 | 1 | 0 | 0 | 2011-09-19T04:12:00.000 | 1 | 1.2 | true | 7,466,375 | 0 | 0 | 0 | 1 | I'm setting up a scripted build of a cross-platform python app (Python 3) and I'd like to create all the distributables from linux. Is that possible? |
CPU Utilization on UNIX | 7,470,125 | 0 | 1 | 541 | 0 | python,shell,unix,cpu | well, you can try to use the top command with "-b -n 1" and grab it's contents and than you can use cut or other tools to get what you need
NOTE: you can add the -p option to limit to a particular process id | 0 | 1 | 0 | 1 | 2011-09-19T11:13:00.000 | 3 | 0 | false | 7,470,045 | 0 | 0 | 0 | 1 | I'm trying to calculate the percentage of CPU% used for a particular process using Python/Shell, but so far nothing.
I have looked at a lot of questions here, but none could help me.
Any suggestions? |
argparse Python modules in cli | 10,015,728 | 2 | 12 | 15,510 | 0 | python,linux,command-line,argparse | If you're on CentOS and don't have an easy RPM to get to Python 2.7, JF's suggestion of pip install argparse is the way to go. Calling out this solution in a new answer. Thanks, JF. | 0 | 1 | 0 | 1 | 2011-09-19T15:45:00.000 | 5 | 0.07983 | false | 7,473,609 | 0 | 0 | 0 | 2 | I am trying to run a python script from the Linux SSH Secure Shell command line environment, and I am trying to import the argparse library, but it gives the error: "ImportError: No module named argparse".
I think that this is because the Python environment that the Linux shell is using does not have the argparse libra... |
argparse Python modules in cli | 7,474,038 | 0 | 12 | 15,510 | 0 | python,linux,command-line,argparse | You're probably using an older version of Python.
The argparse module has been added pretty recently, in Python 2.7. | 0 | 1 | 0 | 1 | 2011-09-19T15:45:00.000 | 5 | 0 | false | 7,473,609 | 0 | 0 | 0 | 2 | I am trying to run a python script from the Linux SSH Secure Shell command line environment, and I am trying to import the argparse library, but it gives the error: "ImportError: No module named argparse".
I think that this is because the Python environment that the Linux shell is using does not have the argparse libra... |
Netbeans 7 not starting up after python plugin installation | 8,114,362 | 1 | 1 | 2,129 | 0 | python,macos,netbeans | I was having a problem with Netbeans 7 not starting. Netbeans had first errored out with no error message. Then it wouldn't start or give me an error. I looked in the .netbeans directory in my user directory, and found and attempted to delete the 'lock' file in that directory. When I first tried to delete it, it said i... | 0 | 1 | 0 | 0 | 2011-09-19T17:31:00.000 | 6 | 0.033321 | false | 7,474,887 | 0 | 0 | 1 | 5 | I went to tools, plugins. Then chose to install the three python items that show up. After installation. I choose the restart netbeans option. But instead of restarting, netbeans just closed. And now it is not opening. Any ideas how to fix this? I normally develop Java on my netbeans 7 install.
I am using a mac osx
I s... |
Netbeans 7 not starting up after python plugin installation | 19,486,580 | 0 | 1 | 2,129 | 0 | python,macos,netbeans | I have the same problem afther installing the python plguin. To solve this problem i deleted the file: org-openide-awt.jar from C:\Users\MYUSERNAME.netbeans\7.0\modules
Regards!
Martín.
PD: I'm using Netbeans 7.0.1 anda Windows 7 64bit. | 0 | 1 | 0 | 0 | 2011-09-19T17:31:00.000 | 6 | 0 | false | 7,474,887 | 0 | 0 | 1 | 5 | I went to tools, plugins. Then chose to install the three python items that show up. After installation. I choose the restart netbeans option. But instead of restarting, netbeans just closed. And now it is not opening. Any ideas how to fix this? I normally develop Java on my netbeans 7 install.
I am using a mac osx
I s... |
Netbeans 7 not starting up after python plugin installation | 7,478,399 | 1 | 1 | 2,129 | 0 | python,macos,netbeans | I had the same issue. Netbeans would die before opening at all. I could not fix it, and had to revert back to 6.9.1. | 0 | 1 | 0 | 0 | 2011-09-19T17:31:00.000 | 6 | 0.033321 | false | 7,474,887 | 0 | 0 | 1 | 5 | I went to tools, plugins. Then chose to install the three python items that show up. After installation. I choose the restart netbeans option. But instead of restarting, netbeans just closed. And now it is not opening. Any ideas how to fix this? I normally develop Java on my netbeans 7 install.
I am using a mac osx
I s... |
Netbeans 7 not starting up after python plugin installation | 8,088,729 | 1 | 1 | 2,129 | 0 | python,macos,netbeans | I had the same problem, but with Windows 7. I deleted the .netbeans directory located in my home folder. That fixed my problem, hope it fixes yours. | 0 | 1 | 0 | 0 | 2011-09-19T17:31:00.000 | 6 | 0.033321 | false | 7,474,887 | 0 | 0 | 1 | 5 | I went to tools, plugins. Then chose to install the three python items that show up. After installation. I choose the restart netbeans option. But instead of restarting, netbeans just closed. And now it is not opening. Any ideas how to fix this? I normally develop Java on my netbeans 7 install.
I am using a mac osx
I s... |
Netbeans 7 not starting up after python plugin installation | 7,475,990 | -1 | 1 | 2,129 | 0 | python,macos,netbeans | I know I'm not answering your question directly, but I too was considering installing the Python plugin in Netbeans 7 but saw that it was still in Beta.
I use WingIDE from wingware for Python development. I'm a Python newbie but I'm told by the pros that Wing is the best IDE for Python. The "101" version is free an... | 0 | 1 | 0 | 0 | 2011-09-19T17:31:00.000 | 6 | -0.033321 | false | 7,474,887 | 0 | 0 | 1 | 5 | I went to tools, plugins. Then chose to install the three python items that show up. After installation. I choose the restart netbeans option. But instead of restarting, netbeans just closed. And now it is not opening. Any ideas how to fix this? I normally develop Java on my netbeans 7 install.
I am using a mac osx
I s... |
fd duplicate from python to child process | 7,478,053 | 0 | 0 | 280 | 0 | python,linux,process,linux-kernel | By default, any file descriptors that a process has open when it forks/execs (which happens during a popen()) are inherited by the child process. If this isn't what you want to happen, you will need to either manually close the file descriptors after forking, or set the fds as close-on-exec using fcntl(fd, F_SETFD, FD_... | 0 | 1 | 0 | 0 | 2011-09-19T22:16:00.000 | 1 | 1.2 | true | 7,477,954 | 1 | 0 | 0 | 1 | i think i have a problem with a ttyUSB device that caused from having 2 open ttyUSB fd's at the same time from different processes.
it goes like this:
i have a main python process, which opens several ttyUSB fd's, read, write, close, and open processes (with popen) to handle each ttyUSB (of course after the fd was clos... |
Python Parallel Processing Amazon EC2 or Alternatives? | 7,478,918 | 1 | 0 | 384 | 0 | python,multithreading,amazon-ec2,cloud,parallel-processing | Your requirements are too vague for a specific response. It is unlikely you are going to be able to elaborate them sufficiently for anybody to provide an authoritative answer.
Fortunately for you, many Infrastructure as a Service platforms like AWS and Rackspace let you test things out extremely inexpensively (literal... | 0 | 1 | 0 | 1 | 2011-09-20T00:21:00.000 | 1 | 1.2 | true | 7,478,803 | 0 | 0 | 1 | 1 | I'm working on running a Memory/CPU intensive project on a cloud service, from my Googling and research it looks like I should use Amazon EC2 as there are guides it using MPI - however, reading up on stackoverflow about people's comparison of EC2 with rackspace, joyent, etc, I was wondering if this is really the best c... |
Make a twister server take initiative | 7,488,756 | 0 | 3 | 252 | 0 | python,twisted | If by "immediately" you mean "when the client connects", try calling sendLine in your LineReceiver subclass's connectionMade. | 0 | 1 | 0 | 0 | 2011-09-20T16:07:00.000 | 3 | 0 | false | 7,488,266 | 0 | 0 | 0 | 2 | I have a server in twisted, implementing a LineReceiver protocol.
When I call sendLine in response to a client message, it writes the line to the client immediately, as one would expect.
But say the client asks the server to do a lengthy calculation. I want the server to periodically send a progress message to the clie... |
Make a twister server take initiative | 7,523,779 | 1 | 3 | 252 | 0 | python,twisted | You can send a line using sendLine whenever you want and it should arrive immediately, but you may have a problem related to your server blocking.
A call to sendLine is deferred, so if you make a call in the middle of a bunch of processing, it's possible that it's not being actioned for a while, and then when a message... | 0 | 1 | 0 | 0 | 2011-09-20T16:07:00.000 | 3 | 0.066568 | false | 7,488,266 | 0 | 0 | 0 | 2 | I have a server in twisted, implementing a LineReceiver protocol.
When I call sendLine in response to a client message, it writes the line to the client immediately, as one would expect.
But say the client asks the server to do a lengthy calculation. I want the server to periodically send a progress message to the clie... |
Does Twisted cache DNS lookups? Does it honour TTL? | 7,488,979 | 2 | 2 | 556 | 0 | python,dns,twisted | I think Twisted simply uses the OS' resolver, so the answer to both questions is "as much as your OS does". | 0 | 1 | 0 | 0 | 2011-09-20T16:46:00.000 | 1 | 1.2 | true | 7,488,720 | 0 | 0 | 0 | 1 | If I use the Twisted Endpoint API to make a series of connections to the same host, will Twisted cache the DNS lookup between requests?
If it does, will it honour the DNS record's TTL?
My implementation is fairly vanilla. I instantiate a SSL4ClientEndpoint with host, port etc, and through the life of the program I use ... |
Odd message and processing hangs | 9,764,576 | 0 | 0 | 85 | 0 | python,amazon-web-services | wberry was correct in his comment, I was running into a max descriptors per process issue. This seems highly dependent on operating system. Reducing the size of the batches I was having each processor handle to below the file descriptor limit of the process solved the problem. | 0 | 1 | 0 | 0 | 2011-09-20T20:51:00.000 | 1 | 1.2 | true | 7,491,614 | 0 | 0 | 0 | 1 | I have a large project that runs on an application server. It does pipelined processing of large batches of data and works fine on one Linux system (the old production environment) and one windows system (my dev environment).
However, we're upgrading our infrastructure and moving to a new linux system for production, b... |
Getting an embedded Python runtime to use the current active virtualenv | 9,071,047 | 2 | 15 | 4,477 | 0 | python,virtualenv | Seems to be not an answer, but still might be useful in other contexts.
Have you tried running bin/activate_this.py from your Python virtualenv? The comment in this file of my virtualenv reads:
By using execfile(this_file, dict(__file__=this_file)) you will
activate this virtualenv environment.
This can be used whe... | 0 | 1 | 0 | 0 | 2011-09-20T23:07:00.000 | 6 | 0.066568 | false | 7,492,855 | 1 | 0 | 0 | 2 | I make heavy use of virtualenv to isolate my development environments from the system-wide Python installation. Typical work-flow for using a virtualenv involves running source /path/to/virtualenv/bin/activate to set the environment variables that Python requires to execute an isolated runtime. Making sure my Python ex... |
Getting an embedded Python runtime to use the current active virtualenv | 31,758,278 | 0 | 15 | 4,477 | 0 | python,virtualenv | You can the check the environment variable VIRTUAL_ENV to get the current envs location. | 0 | 1 | 0 | 0 | 2011-09-20T23:07:00.000 | 6 | 0 | false | 7,492,855 | 1 | 0 | 0 | 2 | I make heavy use of virtualenv to isolate my development environments from the system-wide Python installation. Typical work-flow for using a virtualenv involves running source /path/to/virtualenv/bin/activate to set the environment variables that Python requires to execute an isolated runtime. Making sure my Python ex... |
App Engine problems using the command line | 7,507,801 | 2 | 1 | 219 | 0 | python,django,google-app-engine,command-line,google-cloud-datastore | If you're using Django 0.96 templates within a 'normal' App Engine app, then manage.py isn't involved at all.
/path/to/dev_appserver.py --clear_datastore .
is what you want, assuming you're CD'd to the root of your app. | 0 | 1 | 0 | 0 | 2011-09-21T21:24:00.000 | 1 | 1.2 | true | 7,506,854 | 0 | 0 | 1 | 1 | I am developing an App Engine project on Windows using Eclipse and Python 2.5 and Django 0.96. Everything in my app, including Django, is working nicely.
My problems arise when I try to use command line. For example, I'm told that if I want to clear the local datastore I can enter "python manage.py reset" but when I do... |
Is it necessary to explicitly free memory in Google App Engine's Python environment? | 7,526,870 | 6 | 2 | 617 | 0 | python,google-app-engine | Python has it's own garbage collection so there's no need to release memory manually. | 0 | 1 | 0 | 0 | 2011-09-23T09:15:00.000 | 2 | 1.2 | true | 7,526,746 | 0 | 0 | 1 | 1 | Is there a way to free memory in google's app engine? Is there a garbage collector in python? |
zeromq: how to prevent infinite wait? | 10,846,438 | 10 | 77 | 82,000 | 0 | python,zeromq | The send wont block if you use ZMQ_NOBLOCK, but if you try closing the socket and context, this step would block the program from exiting..
The reason is that the socket waits for any peer so that the outgoing messages are ensured to get queued.. To close the socket immediately and flush the outgoing messages from the ... | 0 | 1 | 1 | 0 | 2011-09-24T12:25:00.000 | 4 | 1 | false | 7,538,988 | 0 | 0 | 0 | 1 | I just got started with ZMQ. I am designing an app whose workflow is:
one of many clients (who have random PULL addresses) PUSH a request to a server at 5555
the server is forever waiting for client PUSHes. When one comes, a worker process is spawned for that particular request. Yes, worker processes can exist concurr... |
How is rate_limit enforced in Celery? | 11,125,501 | 16 | 6 | 1,119 | 0 | python,django,asynchronous,queue,celery | Rate limited tasks are never dropped, they are queued internally in the worker so that they execute as soon as they are allowed to run.
The token bucket algorithm does not specify anything about dropping packets (it is an option, but Celery does not do that). | 0 | 1 | 0 | 0 | 2011-09-24T21:06:00.000 | 1 | 1.2 | true | 7,541,931 | 0 | 0 | 1 | 1 | I'm running a Django website where I use Celery to implement preventive caching - that is, I calculate and cache results even before they are requested by the user.
However, one of my Celery tasks could, in some situation, be called a lot (I'd say sightly quicker than it completes on average, actually). I'd like to rat... |
How to check if a Windows version is Genuine or not? | 7,545,592 | 0 | 2 | 2,226 | 0 | java,c++,python,c,windows | The Java solution is to use Process to run the C++ or VBScript solution as a child process. | 0 | 1 | 0 | 0 | 2011-09-25T11:28:00.000 | 3 | 0 | false | 7,545,206 | 0 | 0 | 0 | 1 | Is it possible to check whether a Windows installation is Genuine or not programmatically?
Lets just say I want to check Windows 7 from C, C++, Java or Python. |
Getting friendly device names in python | 7,552,255 | 7 | 11 | 8,806 | 0 | python,windows,linux,macos | Regarding Linux, if all you need is to enumerate devices, you can even skip pyudev dependency for your project, and simply parse the output of /sbin/udevadm info --export-db command (does not require root privileges). It will dump all information about present devices and classes, including USB product IDs for USB devi... | 0 | 1 | 0 | 0 | 2011-09-26T06:53:00.000 | 6 | 1.2 | true | 7,551,546 | 0 | 0 | 0 | 2 | I have an 2-port signal relay connected to my computer via a USB serial interface. Using the pyserial module I can control these relays with ease. However, this is based on the assumption that I know beforehand which COM-port (or /dev-node) the device is assigned to.
For the project I'm doing that's not enough since I... |
Getting friendly device names in python | 7,552,386 | 0 | 11 | 8,806 | 0 | python,windows,linux,macos | It will be great if this is possible, but in my experience with commercial equipments using COM ports this is not the case. Most of the times you need to set manually in the software the COM port. This is a mess, specially in windows (at least XP) that tends to change the number of the com ports in certain cases. In so... | 0 | 1 | 0 | 0 | 2011-09-26T06:53:00.000 | 6 | 0 | false | 7,551,546 | 0 | 0 | 0 | 2 | I have an 2-port signal relay connected to my computer via a USB serial interface. Using the pyserial module I can control these relays with ease. However, this is based on the assumption that I know beforehand which COM-port (or /dev-node) the device is assigned to.
For the project I'm doing that's not enough since I... |
Shebang Notation: Python Scripts on Windows and Linux? | 7,575,837 | 1 | 85 | 92,049 | 0 | python,windows,linux,shebang | Install pywin32. One of the nice thing is it setups the file association of *.py to the python interpreter. | 0 | 1 | 0 | 0 | 2011-09-27T19:11:00.000 | 6 | 0.033321 | false | 7,574,453 | 1 | 0 | 0 | 2 | I have some small utility scripts written in Python that I want to be usable on both Windows and Linux. I want to avoid having to explicitly invoke the Python interpreter. Is there an easy way to point shebang notation to the correct locations on both Windows and Linux? If not, is there another way to allow implicit... |
Shebang Notation: Python Scripts on Windows and Linux? | 7,574,585 | 42 | 85 | 92,049 | 0 | python,windows,linux,shebang | Unless you are using cygwin, windows has no shebang support. However, when you install python, it add as file association for .py files. If you put just the name of your script on the command line, or double click it in windows explorer, then it will run through python.
What I do is include a #!/usr/bin/env python sheb... | 0 | 1 | 0 | 0 | 2011-09-27T19:11:00.000 | 6 | 1 | false | 7,574,453 | 1 | 0 | 0 | 2 | I have some small utility scripts written in Python that I want to be usable on both Windows and Linux. I want to avoid having to explicitly invoke the Python interpreter. Is there an easy way to point shebang notation to the correct locations on both Windows and Linux? If not, is there another way to allow implicit... |
Every Python IDLE run starts a new process | 29,788,701 | 0 | 0 | 486 | 0 | python,windows,python-idle | I've noticed this on Windows 7, running IDLE v2.7.3; Tk version 8.5; Python 2.7.3
However, it only seems to fail to close the process if you kill a program before it finishes on its own. If possible, let your programs run to their end. | 0 | 1 | 0 | 0 | 2011-09-27T19:34:00.000 | 3 | 0 | false | 7,574,704 | 1 | 0 | 0 | 2 | Windows 7: I'm using Python3.2 with IDLE. Every time I edit and load my program, I get a new "pythonw.exe *32" process (as shown by Windows Task Manager)--even if the program just prints Hello World.
This is a special nuisance if the program is on a static RAM drive, because then I have to kill each of these processes ... |
Every Python IDLE run starts a new process | 7,574,883 | 3 | 0 | 486 | 0 | python,windows,python-idle | Upgrade to version 3.2.2. That fixed the bug for me. I saw the same thing in 3.2.1. | 0 | 1 | 0 | 0 | 2011-09-27T19:34:00.000 | 3 | 1.2 | true | 7,574,704 | 1 | 0 | 0 | 2 | Windows 7: I'm using Python3.2 with IDLE. Every time I edit and load my program, I get a new "pythonw.exe *32" process (as shown by Windows Task Manager)--even if the program just prints Hello World.
This is a special nuisance if the program is on a static RAM drive, because then I have to kill each of these processes ... |
pythonw.exe processes not quitting after running script | 7,592,072 | 1 | 2 | 2,421 | 0 | python,process,python-idle | Have you tried using python.exe instead of pythonw.exe?
Im pretty sure this is the intended default behavior for the window python interperter (pythonw.exe).
If its a .pyw file, just right click "Open With..." and use python.exe | 0 | 1 | 0 | 0 | 2011-09-29T03:02:00.000 | 1 | 1.2 | true | 7,592,008 | 1 | 0 | 0 | 1 | Every time I restart the shell or run a script and instance of pythonw.exe*32 is created. When I close out of IDLE these processes don't go away in the task manager. Any ideas on how to fix this?
Thanks! |
PyPy on Windows 7 x64? | 7,609,593 | 16 | 14 | 10,736 | 0 | python,win64,pypy | PyPy is not compatible with 64bit windows. Primary reason is that sizeof(void*) != sizeof(long) which is a bit annoying. Contributions are more than welcome :) | 0 | 1 | 0 | 0 | 2011-09-30T09:33:00.000 | 4 | 1 | false | 7,608,503 | 1 | 0 | 0 | 3 | I am trying to use PyPy on a Windows 7 x64 machine but do not find any way to do it.
Apparently there is a win32 binary, but no x64 binary or installation guide.
I am currently using Python 2.7.2 win64 (Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32).
Installation from sources raised... |
PyPy on Windows 7 x64? | 7,608,534 | 6 | 14 | 10,736 | 0 | python,win64,pypy | There's no version available for 64 bit Python on Windows. You appear to have the following options:
Download the source to PyPy and port it to 64 bit.
Switch to 32 bit Python.
Option 2 looks more tractable. | 0 | 1 | 0 | 0 | 2011-09-30T09:33:00.000 | 4 | 1 | false | 7,608,503 | 1 | 0 | 0 | 3 | I am trying to use PyPy on a Windows 7 x64 machine but do not find any way to do it.
Apparently there is a win32 binary, but no x64 binary or installation guide.
I am currently using Python 2.7.2 win64 (Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32).
Installation from sources raised... |
PyPy on Windows 7 x64? | 29,459,581 | 3 | 14 | 10,736 | 0 | python,win64,pypy | Just an update on this issue if anyone read it nowadays: PyPy seems to have solved their issues with Windows x64, you can download the 32-bit version of PyPy and it will work flawlessly under Windows 7 x64 (I even have a 64-bit python install beside, and pypy is working nicely along, I just have to specify the full pat... | 0 | 1 | 0 | 0 | 2011-09-30T09:33:00.000 | 4 | 0.148885 | false | 7,608,503 | 1 | 0 | 0 | 3 | I am trying to use PyPy on a Windows 7 x64 machine but do not find any way to do it.
Apparently there is a win32 binary, but no x64 binary or installation guide.
I am currently using Python 2.7.2 win64 (Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32).
Installation from sources raised... |
How can I run a program in msys through Python? | 7,613,945 | 1 | 4 | 2,618 | 0 | python,msys | Find where in the msys path libgcc_s_dw2-1.dll is.
Find the environmental variable in MSYS that has that path in it.
Add that environmental variable to Windows. | 0 | 1 | 0 | 0 | 2011-09-30T16:47:00.000 | 1 | 1.2 | true | 7,613,525 | 1 | 0 | 0 | 1 | I've got a short python script that will eventually edit an input file, run an executable on that input file and read the output from the executable. The problem is, I've compiled the executable through msys, and can only seem to run it from the msys window. I'm wondering if the easiest way to do this is to somehow use... |
Is there any loss of functionality with streaming jobs in hbase/hadoop versus using java? | 7,707,068 | 1 | 3 | 758 | 0 | java,python,hadoop,hbase,thrift | Yes, you should get data local code execution with streaming. You do not push the data to where the program is, you push the program to where the data is. Streaming simply takes the local input data and runs it through stdin to your python program. Instead of each map running inside of a java task, it spins up and ins... | 0 | 1 | 0 | 0 | 2011-10-02T00:27:00.000 | 2 | 0.099668 | false | 7,623,858 | 0 | 0 | 1 | 1 | Sorry in advance if this is a basic question. I'm reading a book on hbase and learing but most of the examples in the book(and well as online) tend to be using Java(I guess because hbase is native to java). There are a few python examples and I know I can access hbase with python(using thrift or other modules), but I'... |
Python/C Raw Socket Operations using Django, Mod_WSGI, Apache | 7,630,026 | 1 | 2 | 344 | 0 | python,django,sockets,mod-wsgi,freebsd | Use Celery or some other back end service which runs as root. Having a web application process run as root is a security problem waiting to happen. This is why mod_wsgi blocks you running daemon processes as root. Sure you could hack the code to disable the exclusion, but I am not about to tell you how to do that. | 0 | 1 | 0 | 0 | 2011-10-02T20:07:00.000 | 1 | 0.197375 | false | 7,628,889 | 0 | 0 | 1 | 1 | I'm currently writing a web application using Django, Apache, and mod_wsgi that provides some FreeBSD server management and configuration features, including common firewall operations.
My Python/C library uses raw sockets to interact directly with the firewall and works perfectly fine when running as root, but raw so... |
Can Gstreamer be used server-side to stream audio to multiple clients on demand? | 7,634,531 | 1 | 2 | 1,045 | 0 | python,audio,stream,gstreamer | You might want to look at Flumotion (www.flumotion.org). It is a python based streaming server using GStreamer, you might be able to get implementation ideas from that in terms of how you do your application. It relies heavily on the python library Twisted for its network handling. | 0 | 1 | 0 | 0 | 2011-10-03T02:17:00.000 | 1 | 0.197375 | false | 7,630,548 | 0 | 0 | 1 | 1 | I'm working on an audio mixing program (DAW) web app, and considering using Python and Python Gstreamer for the backend. I understand that I can contain the audio tracks of a single music project in a gst.Pipeline bin, but playback also appears to be controlled by this Pipeline.
Is it possible to create several "views... |
Control rs232 windows terminal program from python | 7,712,917 | 0 | 2 | 1,707 | 0 | python,windows,python-3.x,serial-port,automated-tests | I was also able to solve this using WScript, but pySerial was the preferred solution. | 0 | 1 | 0 | 1 | 2011-10-03T08:27:00.000 | 3 | 0 | false | 7,632,642 | 0 | 0 | 0 | 1 | I am testing a piece of hardware which hosts an ftp server. I connect to the server in order to configure the hardware in question.
My test environment is written in Python 3.
To start the ftp server, I need to launch a special proprietary terminal application on my pc. I must use this software as far as I know and I h... |
How can I test the validity of a ReferenceProperty in Appengine? | 7,637,063 | 3 | 2 | 199 | 0 | python,google-app-engine,google-cloud-datastore | This will test key existence without returning an entity:
db.Query(keys_only=True).filter('__key__ =', test_key).count(1) == 1
I'm not certain that it's computationally cheaper than fetching the entity. | 0 | 1 | 0 | 0 | 2011-10-03T15:02:00.000 | 1 | 1.2 | true | 7,636,806 | 0 | 0 | 1 | 1 | I am currently testing a small application I have written. I have not been sufficiently careful in ensuring the data in my datastore is consistent and now I have an issue that I have some records referencing objects which no longer exist. More specifially, I have some objects which have ReferenceProperty's which have b... |
easy_install failure on windows 7 | 7,638,140 | 1 | 0 | 541 | 0 | python,windows-7,easy-install | This error:
bad local file header
seems to say that the file header (which usually determines the filetype) isn't passing Python's test. It could be the zipping program you used.
Try 7-Zip (free) or a different program when creating your egg. I haven't made them before, but I think there is even a way to do it with p... | 0 | 1 | 0 | 0 | 2011-10-03T16:51:00.000 | 1 | 0.197375 | false | 7,638,109 | 1 | 0 | 0 | 1 | I have created two eggs using bdist and egg_A is defines as a dependency of egg_B.
I check both egg using the command unzip and both are ok, however when I try to insall the egg using easy_install I get the following stack trace :
Installed c:\virtualenv\lib\site-packages\pymarketdata-1.0-py2.7.egg
Reading file:C:/pyt... |
Execute Python Script as Root (seteuid vs c-wrapper) | 7,639,481 | 3 | 13 | 4,966 | 0 | python,c,django,freebsd | The correct thing is called privilege separation: clearly identify minimal set of tasks which have to be done on elevated privileges. Write a separate daemon and an as much limited as possible way of communicating the task to do. Run this daemon as another user with elevated privileges. A bit more work, but also more s... | 0 | 1 | 0 | 1 | 2011-10-03T18:33:00.000 | 3 | 0.197375 | false | 7,639,141 | 0 | 0 | 0 | 1 | I have a quick one off task in a python script that I'd like to call from Django (www user), that's going to need to root privileges.
At first I thought I would could use Python's os.seteuid() and set the setuid bit on the script, but then I realized that I would have to set the setuid bit on Python itself, which I as... |
how to copy a file between 2 computers on the network in python | 7,641,519 | 1 | 0 | 2,350 | 0 | python | NFS mount the filesystem, then both systems can access the same files as if they were local. Otherwise you could use sockets. | 0 | 1 | 0 | 0 | 2011-10-03T22:39:00.000 | 2 | 1.2 | true | 7,641,481 | 0 | 0 | 0 | 1 | I am trying to move a log file from a computer, where an operation is performed, to another computer, that will get the log file and process it, returning a document with the result of the analysis.
I am using Python for the job, but I am open to other options (I have to run this copy via console on OSX, due the fact t... |
Building binary python distributions for multiple OS X versions | 13,315,980 | 1 | 3 | 1,843 | 0 | python,macos,build,cross-compiling,distutils | I found the solution, go into your /System/Library/Frameworks/Python.framework/Versions/2.7/lib/distutils/sysconfig.py
Goto line 408 that says "raise DistutilsPlatformError" and add a '#' to comment out that line of code... This will "unleash the python"
You are basically telling python "don't worry its not 10.7, I kno... | 0 | 1 | 0 | 0 | 2011-10-04T21:34:00.000 | 2 | 0.099668 | false | 7,654,316 | 1 | 0 | 0 | 1 | I am attempting to build a python application with binary modules on OS X. I want to build versions for Snow Leopard and Leopard from Lion. I have XCode 4 installed with the 10.5 and 10.6 sdks and have been attempting to build using the MACOSX_DEPLOYMENT_TARGET flag set to 10.6. I receive an error from distutils com... |
What are the different options for social authentication on Appengine - how do they compare? | 7,662,946 | 11 | 6 | 552 | 0 | python,google-app-engine,oauth,openid,facebook-authentication | In my research on this question I found that there are essentially three options:
Use Google's authentication mechanisms (including their federated login via OpenID)
Pros:
You can easily check who is logged in via the Users service provided with Appengine
Google handles the security so you can be quite sure it's wel... | 0 | 1 | 0 | 1 | 2011-10-05T10:42:00.000 | 1 | 1.2 | true | 7,660,059 | 0 | 0 | 1 | 1 | [This question is intended as a means to both capture my findings and sanity check them - I'll put up my answer toute suite and see what other answers and comments appear.]
I spent a little time trying to get my head around the different social authentication options for (python) Appengine. I was particularly confused ... |
App Engine memcache speed "dict" vs "Class Object" | 7,661,286 | 1 | 0 | 409 | 0 | python,google-app-engine | You need to measure but for all intended purposes the results should be that its about the same speed.
If any method tend to be faster I don't really think its going to impact you overall performance that much.
Your main latency will be the RPC call to the memache which might be two factor slower then the slowest seria... | 0 | 1 | 0 | 0 | 2011-10-05T10:57:00.000 | 3 | 1.2 | true | 7,660,231 | 0 | 0 | 1 | 1 | I have page handler with 95% traffic, it fetches model from DB using its key and then uses fields in the fetched model to fill a django template.
I want to memcache the fetched model so as to avoid DB reads. Not all fields of the model are used in template so i want to cache it with just the required feilds so as to i... |
Purpose of #!/usr/bin/python3 shebang | 7,720,640 | 13 | 221 | 273,899 | 0 | python,scripting | This line helps find the program executable that will run the script. This shebang notation is fairly standard across most scripting languages (at least as used on grown-up operating systems).
An important aspect of this line is specifying which interpreter will be used. On many development-centered Linux distributions... | 0 | 1 | 0 | 1 | 2011-10-06T04:29:00.000 | 7 | 1 | false | 7,670,303 | 1 | 0 | 0 | 4 | I have noticed this in a couple of scripting languages, but in this example, I am using python. In many tutorials, they would start with #!/usr/bin/python3 on the first line. I don't understand why we have this.
Shouldn't the operating system know it's a python script (obviously it's installed since you are making a r... |
Purpose of #!/usr/bin/python3 shebang | 7,670,323 | 7 | 221 | 273,899 | 0 | python,scripting | And this line is how.
It is ignored.
It will fail to run, and should be changed to point to the proper location. Or env should be used.
It will fail to run, and probably fail to run under a different version regardless. | 0 | 1 | 0 | 1 | 2011-10-06T04:29:00.000 | 7 | 1 | false | 7,670,303 | 1 | 0 | 0 | 4 | I have noticed this in a couple of scripting languages, but in this example, I am using python. In many tutorials, they would start with #!/usr/bin/python3 on the first line. I don't understand why we have this.
Shouldn't the operating system know it's a python script (obviously it's installed since you are making a r... |
Purpose of #!/usr/bin/python3 shebang | 52,982,676 | 3 | 221 | 273,899 | 0 | python,scripting | Actually the determination of what type of file a file is very complicated, so now the operating system can't just know. It can make lots of guesses based on -
extension
UTI
MIME
But the command line doesn't bother with all that, because it runs on a limited backwards compatible layer, from when that fancy nonsense ... | 0 | 1 | 0 | 1 | 2011-10-06T04:29:00.000 | 7 | 0.085505 | false | 7,670,303 | 1 | 0 | 0 | 4 | I have noticed this in a couple of scripting languages, but in this example, I am using python. In many tutorials, they would start with #!/usr/bin/python3 on the first line. I don't understand why we have this.
Shouldn't the operating system know it's a python script (obviously it's installed since you are making a r... |
Purpose of #!/usr/bin/python3 shebang | 7,670,334 | 28 | 221 | 273,899 | 0 | python,scripting | That's called a hash-bang. If you run the script from the shell, it will inspect the first line to figure out what program should be started to interpret the script.
A non Unix based OS will use its own rules for figuring out how to run the script. Windows for example will use the filename extension and the # will caus... | 0 | 1 | 0 | 1 | 2011-10-06T04:29:00.000 | 7 | 1 | false | 7,670,303 | 1 | 0 | 0 | 4 | I have noticed this in a couple of scripting languages, but in this example, I am using python. In many tutorials, they would start with #!/usr/bin/python3 on the first line. I don't understand why we have this.
Shouldn't the operating system know it's a python script (obviously it's installed since you are making a r... |
How can I keep Task Manager from killing my pythonw script? | 7,680,857 | 0 | 0 | 734 | 0 | python,windows,process,taskmanager | Hopefully you aren't giving "public" general users administrative privileges. Don't give the public account permission to close your script. Then you just run your script from a different user account than the account the general public can use. | 0 | 1 | 0 | 0 | 2011-10-06T07:34:00.000 | 1 | 0 | false | 7,671,375 | 0 | 0 | 0 | 1 | I want to run a python script for several days, performing a huge database calculation, on a "public" windows computer in my work place.
Since this task is important, I want to prevent closing it from the task manager.
Is it possible to protect a python script from being closed by the task manager (windows xp)? If it... |
Rsyslog + Virtualenv | 8,363,498 | 2 | 1 | 321 | 0 | python,centos,virtualenv,rsyslog | Have you ever asked a question while researching something, then learned what you needed to do and then wished you hadn't asked the question?
All you need to do is modify your python path and add the path to the site-packages directory of the virtualenv you want to use. | 0 | 1 | 0 | 1 | 2011-10-07T12:35:00.000 | 1 | 1.2 | true | 7,687,332 | 0 | 0 | 0 | 1 | I'm using a shell execute action in rsyslog to a python script on a CentOS machine. How can I ensure that it runs in a specified virtualenv? |
Python self contained web application and server? | 7,721,670 | 0 | 6 | 1,744 | 0 | python,deployment | cherrypy is the easiest one to use, django is feature rich and tornado is more advanced with asynchrounous web server(in my opinion it is better than multithreaded web server).
For what you want, django is best suitable for you IMO. | 0 | 1 | 0 | 0 | 2011-10-07T14:10:00.000 | 3 | 0 | false | 7,688,442 | 0 | 0 | 1 | 1 | What is a good and easy way to distribute a web application and server bundled together, python way?
So I can say to a user "Here take this tar/whatever, unpack it and run blahblah.py" and blahblah.py will run a http/wsgi server and serve my application?
Im looking for a stable production-ready multi-threaded wsgi-serv... |
Can someone explain parallelpython versus hadoop for distributing python process across various servers? | 7,704,037 | 2 | 3 | 540 | 0 | python,hadoop,parallel-processing | The main difference is that Hadoop is good at processing big data (dozen to terabytes of data). It provides a simple logical framework called MapReduce which is well appropriate for data aggregation, and a distributed storage system called HDFS.
If your inputs are smaller than 1 gigabyte, you probably don't want to use... | 0 | 1 | 0 | 0 | 2011-10-09T07:12:00.000 | 2 | 0.197375 | false | 7,701,989 | 1 | 0 | 0 | 2 | I'm new to using multiple cpu's to process jobs and was wondering if people could let me know the pro/cons of parallelpython(or any type of python module) versus hadoop streaming?
I have a very large cpu intensive process that I would like to spread across several servers. |
Can someone explain parallelpython versus hadoop for distributing python process across various servers? | 7,705,052 | 2 | 3 | 540 | 0 | python,hadoop,parallel-processing | Since moving data becomes harder and harder with size; when it comes to parallel computing, data localization becomes very important. Hadoop as a map/reduce framework maximizes the localization of data being processed. It also gives you a way to spread your data efficiently across your cluster (hdfs). So basically, eve... | 0 | 1 | 0 | 0 | 2011-10-09T07:12:00.000 | 2 | 1.2 | true | 7,701,989 | 1 | 0 | 0 | 2 | I'm new to using multiple cpu's to process jobs and was wondering if people could let me know the pro/cons of parallelpython(or any type of python module) versus hadoop streaming?
I have a very large cpu intensive process that I would like to spread across several servers. |
usr/bin/env: bad interpreter Permission Denied --> how to change the fstab | 16,814,809 | 1 | 10 | 33,994 | 0 | python,permissions,cygwin | This seems to be a late answer, but may be useful for others. I got the same kinda error, when I was trying to run a shell script which used python. Please check \usr\bin for existence of python. If not found, install that to solve the issue. I come to such a conclusion, as the error shows "bad interpreter". | 0 | 1 | 0 | 0 | 2011-10-10T17:22:00.000 | 8 | 0.024995 | false | 7,716,357 | 1 | 0 | 0 | 2 | I'm using cygwin on windows 7 to run a bash script that activates a python script, and I am getting the following error:
myscript.script: /cydrive/c/users/mydrive/folder/myscript.py: usr/bin/env: bad interpreter: Permission Denied.
I'm a total newbie to programming, so I've looked around a bit, and I think this means P... |
usr/bin/env: bad interpreter Permission Denied --> how to change the fstab | 26,632,686 | 0 | 10 | 33,994 | 0 | python,permissions,cygwin | You should write your command as 'python ./example.py ',then fix it in your script. | 0 | 1 | 0 | 0 | 2011-10-10T17:22:00.000 | 8 | 0 | false | 7,716,357 | 1 | 0 | 0 | 2 | I'm using cygwin on windows 7 to run a bash script that activates a python script, and I am getting the following error:
myscript.script: /cydrive/c/users/mydrive/folder/myscript.py: usr/bin/env: bad interpreter: Permission Denied.
I'm a total newbie to programming, so I've looked around a bit, and I think this means P... |
Writing a telnet server in Python and embedding IPython as shell | 7,723,501 | 0 | 1 | 830 | 0 | python,ipython | I think it is not possible provide full functionality of IPython, such as auto complete,.. Twisted has python shell that works well with telnet. | 0 | 1 | 0 | 0 | 2011-10-11T08:43:00.000 | 2 | 0 | false | 7,723,399 | 0 | 0 | 0 | 1 | I am trying to write a simple telned server that will expose a IPython shell to the connected client. Does someone know how to do that ?
The question is really about embedding the IPython shell into the Telnet server (I can probably use Twisted for the Telnet server part )
Thx |
Running IPython after changing the filename of python.exe | 7,820,862 | 0 | 0 | 550 | 0 | python,windows,interpreter,ipython | Found a solution:
python27.exe c:\Python27\Scripts\ipython-script.py | 0 | 1 | 0 | 0 | 2011-10-11T13:42:00.000 | 4 | 1.2 | true | 7,727,017 | 1 | 0 | 0 | 4 | If I rename the python interpreter from C:\Python27\python.exe to C:\Python27\python27.exe and run it, it will not complain.
But if I now try to run C:\Python27\Scripts\ipython.exe, it will fail to start because now the python interpreter has a different filename.
My question is: how do I configure IPython (ms windows)... |
Running IPython after changing the filename of python.exe | 7,727,342 | 1 | 0 | 550 | 0 | python,windows,interpreter,ipython | Try to find Python in windows registry and changes path to python. After that try to reinstall ipython. | 0 | 1 | 0 | 0 | 2011-10-11T13:42:00.000 | 4 | 0.049958 | false | 7,727,017 | 1 | 0 | 0 | 4 | If I rename the python interpreter from C:\Python27\python.exe to C:\Python27\python27.exe and run it, it will not complain.
But if I now try to run C:\Python27\Scripts\ipython.exe, it will fail to start because now the python interpreter has a different filename.
My question is: how do I configure IPython (ms windows)... |
Running IPython after changing the filename of python.exe | 7,727,120 | 0 | 0 | 550 | 0 | python,windows,interpreter,ipython | I do not know if there is a config file where you can change, but you may have to recompile Ipython and change the interpreter variables. But why do you need to rename it to python27.exe when it already is in a python27 folder? | 0 | 1 | 0 | 0 | 2011-10-11T13:42:00.000 | 4 | 0 | false | 7,727,017 | 1 | 0 | 0 | 4 | If I rename the python interpreter from C:\Python27\python.exe to C:\Python27\python27.exe and run it, it will not complain.
But if I now try to run C:\Python27\Scripts\ipython.exe, it will fail to start because now the python interpreter has a different filename.
My question is: how do I configure IPython (ms windows)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.