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 process long-running requests in python workers?
1,676,102
0
4
2,509
0
python,nginx,load-balancing,wsgi,reverse-proxy
You could use nginx load balancer to proxy to PythonPaste paster (which serves WSGI, for example Pylons), that launches each request as separate thread anyway.
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 ...
Can I add Runtime Properties to a Python App Engine App?
1,674,790
1
0
158
0
python,google-app-engine,properties,runtime
You can: edit records in the datastore through the dashboard ( if you really have to ) upload new scripts / files ( you can access files in READ-ONLY ) export a WEB Service API to configuration records in the datastore ( probably not what you had in mind ) access a page somewhere through an HTTP end-point
0
1
0
0
2009-11-04T15:58:00.000
2
1.2
true
1,674,764
0
0
1
1
Coming from a java background I'm used to having a bunch of properties files I can swap round at runtime dependent on what server I'm running on e.g. dev/production. Is there a method in python to do similar, specifically on Google's App Engine framework? At the minute I have them defined in .py files, obviously I'd li...
GTK+ Startup Notification Icon
1,680,360
0
7
840
0
python,linux,ubuntu,gnome
This normally happens automatically when calling the gtk.main() function
1
1
0
0
2009-11-05T12:39:00.000
4
0
false
1,680,311
0
0
0
1
In Gnome, whenever an application is started, the mouse cursor changes from normal to an activity indicator (a spinning wheel type thing on Ubuntu). Is there any way to inform Gnome (through some system call) when the application has finished launching so that the mouse cursor returns to normal without waiting for the ...
Python: Platform independent way to modify PATH environment variable
1,681,256
6
102
88,027
0
python,path,cross-platform,environment-variables
The caveat to be aware of with modifying environment variables in Python, is that there is no equivalent of the "export" shell command. There is no way of injecting changes into the current process, only child processes.
0
1
0
0
2009-11-05T15:17:00.000
4
1
false
1,681,208
1
0
0
1
Is there a way to modify the PATH environment variable in a platform independent way using python? Something similar to os.path.join()?
Limitations of TEMP directory in Windows?
1,683,853
1
5
13,119
0
python,windows,temporary-files
There shouldn't be such space limitation in Temp. If you wrote the app, I would recommend creating your files in ProgramData...
0
1
0
0
2009-11-05T21:39:00.000
4
0.049958
false
1,683,831
0
0
0
3
I have an application written in Python that's writing large amounts of data to the %TEMP% folder. Oddly, every once and awhile, it dies, returning IOError: [Errno 28] No space left on device. The drive has plenty of free space, %TEMP% is not its own partition, I'm an administrator, and the system has no quotas. Does...
Limitations of TEMP directory in Windows?
1,683,908
2
5
13,119
0
python,windows,temporary-files
Using a FAT32 filesystem I can imagine this happening when: Writing a lot of data to one file, and you reach the 4GB file size cap. Or when you are creating a lot of small files and reaching the 2^16-2 files per directory cap. Apart from this, I don't know of any limitations the system can impose on the temp folder, ...
0
1
0
0
2009-11-05T21:39:00.000
4
0.099668
false
1,683,831
0
0
0
3
I have an application written in Python that's writing large amounts of data to the %TEMP% folder. Oddly, every once and awhile, it dies, returning IOError: [Errno 28] No space left on device. The drive has plenty of free space, %TEMP% is not its own partition, I'm an administrator, and the system has no quotas. Does...
Limitations of TEMP directory in Windows?
1,683,911
0
5
13,119
0
python,windows,temporary-files
There should be no trouble whatsoever with regard to your %TEMP% directory. What is your disk quota set to for %TEMP%'s hosting volume? Depending in part on what the apps themselves are doing, one of them may be throwing an error due to the disk quota being reached, which is a pain if this quota is set unreasonably ...
0
1
0
0
2009-11-05T21:39:00.000
4
0
false
1,683,831
0
0
0
3
I have an application written in Python that's writing large amounts of data to the %TEMP% folder. Oddly, every once and awhile, it dies, returning IOError: [Errno 28] No space left on device. The drive has plenty of free space, %TEMP% is not its own partition, I'm an administrator, and the system has no quotas. Does...
Updating Python on Mac
67,923,827
-4
140
519,726
0
python,macos,python-3.x
You can do it from Terminal too. It's quite easy. You just need to type python3 --version and
0
1
0
0
2009-11-06T12:45:00.000
23
-1
false
1,687,357
1
0
0
7
I wanted to update my python 2.6.1 to 3.x on mac but i was wondering if its possible to do it using terminal or i have to download the installer from python website? The reason why i am asking this question is because installer is not updating my terminal python version.
Updating Python on Mac
1,687,431
5
140
519,726
0
python,macos,python-3.x
I believe Python 3 can coexist with Python 2. Try invoking it using "python3" or "python3.1". If it fails, you might need to uninstall 2.6 before installing 3.1.
0
1
0
0
2009-11-06T12:45:00.000
23
0.043451
false
1,687,357
1
0
0
7
I wanted to update my python 2.6.1 to 3.x on mac but i was wondering if its possible to do it using terminal or i have to download the installer from python website? The reason why i am asking this question is because installer is not updating my terminal python version.
Updating Python on Mac
1,688,349
3
140
519,726
0
python,macos,python-3.x
I personally wouldn't mess around with OSX's python like they said. My personally preference for stuff like this is just using MacPorts and installing the versions I want via command line. MacPorts puts everything into a separate direction (under /opt I believe), so it doesn't override or directly interfere with the re...
0
1
0
0
2009-11-06T12:45:00.000
23
0.026081
false
1,687,357
1
0
0
7
I wanted to update my python 2.6.1 to 3.x on mac but i was wondering if its possible to do it using terminal or i have to download the installer from python website? The reason why i am asking this question is because installer is not updating my terminal python version.
Updating Python on Mac
47,333,658
0
140
519,726
0
python,macos,python-3.x
First, install Homebrew (The missing package manager for macOS) if you haven': Type this in your terminal /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" Now you can update your Python to python 3 by this command brew install python3 && cp /usr/local/bin/python3 /usr/...
0
1
0
0
2009-11-06T12:45:00.000
23
0
false
1,687,357
1
0
0
7
I wanted to update my python 2.6.1 to 3.x on mac but i was wondering if its possible to do it using terminal or i have to download the installer from python website? The reason why i am asking this question is because installer is not updating my terminal python version.
Updating Python on Mac
66,423,786
2
140
519,726
0
python,macos,python-3.x
Sometimes when you install Python from the install wizard on MAC it will not link to your bash profile. Since you are using homebrew, just to brew install python This would install the latest version of Python and then to link them brew link python@3.9
0
1
0
0
2009-11-06T12:45:00.000
23
0.01739
false
1,687,357
1
0
0
7
I wanted to update my python 2.6.1 to 3.x on mac but i was wondering if its possible to do it using terminal or i have to download the installer from python website? The reason why i am asking this question is because installer is not updating my terminal python version.
Updating Python on Mac
71,035,575
1
140
519,726
0
python,macos,python-3.x
Install Home brew /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" Install python 3 brew install python3 && cp /usr/local/bin/python3 /usr/local/bin/python Update python to latest version ln -s -f /usr/local/bin/python[your-latest-version-just-installed] /usr/local/bin/pyt...
0
1
0
0
2009-11-06T12:45:00.000
23
0.008695
false
1,687,357
1
0
0
7
I wanted to update my python 2.6.1 to 3.x on mac but i was wondering if its possible to do it using terminal or i have to download the installer from python website? The reason why i am asking this question is because installer is not updating my terminal python version.
Updating Python on Mac
61,615,371
1
140
519,726
0
python,macos,python-3.x
If it were me, I would just leave it as it is. Use python3 and pip3 to run your files since python and python3 can coexist. brew install python3 && cp /usr/local/bin/python3 /usr/local/bin/python You can use the above line but it might have unintended consequences.
0
1
0
0
2009-11-06T12:45:00.000
23
0.008695
false
1,687,357
1
0
0
7
I wanted to update my python 2.6.1 to 3.x on mac but i was wondering if its possible to do it using terminal or i have to download the installer from python website? The reason why i am asking this question is because installer is not updating my terminal python version.
Run Python script without Windows console appearing
1,689,269
36
71
105,900
0
python,windows,shell
If you name your files with the ".pyw" extension, then windows will execute them with the pythonw.exe interpreter. This will not open the dos console for running your script.
0
1
0
0
2009-11-06T17:16:00.000
9
1
false
1,689,015
0
0
0
3
Is there any way to run a Python script in Windows XP without a command shell momentarily appearing? I often need to automate WordPerfect (for work) with Python, and even if my script has no output, if I execute it from without WP an empty shell still pops up for a second before disappearing. Is there any way to preven...
Run Python script without Windows console appearing
62,431,147
-2
71
105,900
0
python,windows,shell
I had the same problem. I tried many options, and all of them failed But I tried this method, and it magically worked!!!!! So, I had this python file (mod.py) in a folder, I used to run using command prompt When I used to close the cmd the gui is automatically closed.....(SAD), So I run it as follows C:\....>pythonw m...
0
1
0
0
2009-11-06T17:16:00.000
9
-0.044415
false
1,689,015
0
0
0
3
Is there any way to run a Python script in Windows XP without a command shell momentarily appearing? I often need to automate WordPerfect (for work) with Python, and even if my script has no output, if I execute it from without WP an empty shell still pops up for a second before disappearing. Is there any way to preven...
Run Python script without Windows console appearing
69,071,490
0
71
105,900
0
python,windows,shell
Turn of your window defender. And install pyinstaller package using pip install pyinstaller . After installing open cmd and type pyinstaller --onefile --noconsole filename.py
0
1
0
0
2009-11-06T17:16:00.000
9
0
false
1,689,015
0
0
0
3
Is there any way to run a Python script in Windows XP without a command shell momentarily appearing? I often need to automate WordPerfect (for work) with Python, and even if my script has no output, if I execute it from without WP an empty shell still pops up for a second before disappearing. Is there any way to preven...
How do I upload data to Google App Engine periodically?
1,690,155
0
0
400
0
python,security,google-app-engine,automation
Can you break up the scraping process into independent chunks that can each finish in the timeframe of an appengine request? (which can run longer than one second btw). Then you can just spawn a bunch of tasks using the task API that when combined, accomplish the full scrape. Then use the cron API to spawn off those ...
0
1
0
0
2009-11-06T18:56:00.000
5
0
false
1,689,570
0
0
1
4
I'm writing an aggregation application which scrapes data from a couple of web sources and displays that data with a novel interface. The sites from which I'm scraping update every couple of minutes, and I want to make sure the data on my aggregator is up-to-date. What's the best way to periodically submit fresh data t...
How do I upload data to Google App Engine periodically?
1,690,150
3
0
400
0
python,security,google-app-engine,automation
Write a Task Queue task or an App Engine cron job to handle this. I'm not sure where you heard that there's a limit of 1 second on any sort of App Engine operations - requests are limited to 30 seconds, and URL fetches have a maximum deadline of 10 seconds.
0
1
0
0
2009-11-06T18:56:00.000
5
1.2
true
1,689,570
0
0
1
4
I'm writing an aggregation application which scrapes data from a couple of web sources and displays that data with a novel interface. The sites from which I'm scraping update every couple of minutes, and I want to make sure the data on my aggregator is up-to-date. What's the best way to periodically submit fresh data t...
How do I upload data to Google App Engine periodically?
1,689,805
0
0
400
0
python,security,google-app-engine,automation
The only way to get data into AppEngine is to call up a Web app of yours (as a Web app) and feed it data through the usual HTTP-ish means, i.e. as parameters to a GET request (for short data) or to a POST (if long or binary). In other words, you'll have to craft your own little dataloader, which you will access as a We...
0
1
0
0
2009-11-06T18:56:00.000
5
0
false
1,689,570
0
0
1
4
I'm writing an aggregation application which scrapes data from a couple of web sources and displays that data with a novel interface. The sites from which I'm scraping update every couple of minutes, and I want to make sure the data on my aggregator is up-to-date. What's the best way to periodically submit fresh data t...
How do I upload data to Google App Engine periodically?
1,693,701
0
0
400
0
python,security,google-app-engine,automation
I asked around and some friends came up with two solutions: Upload a file with a shared secret token along with the application, but when committing to the codebase, change the token. Create a small datastore model with one row, a secret token. In both cases the token can be used to authenticate POST requests used to...
0
1
0
0
2009-11-06T18:56:00.000
5
0
false
1,689,570
0
0
1
4
I'm writing an aggregation application which scrapes data from a couple of web sources and displays that data with a novel interface. The sites from which I'm scraping update every couple of minutes, and I want to make sure the data on my aggregator is up-to-date. What's the best way to periodically submit fresh data t...
Is TCP Guaranteed to arrive in order?
1,691,189
53
43
30,177
0
python,tcp,twisted,protocols
As long as the two messages were sent on the same TCP connection, order will be maintained. If multiple connections are opened between the same pair of processes, you may be in trouble. Regarding Twisted, or any other asynchronous event system: I expect you'll get the dataReceived messages in the order that bytes are ...
0
1
0
0
2009-11-06T23:16:00.000
4
1.2
true
1,691,179
0
0
0
3
If I send two TCP messages, do I need to handle the case where the latter arrives before the former? Or is it guaranteed to arrive in the order I send it? I assume that this is not a Twisted-specific example, because it should conform to the TCP standard, but if anyone familiar with Twisted could provide a Twisted-spec...
Is TCP Guaranteed to arrive in order?
1,691,197
25
43
30,177
0
python,tcp,twisted,protocols
TCP is connection-oriented and offers its Clients in-order delivery. Of course this applies to the connection level: individual connections are independent. You should note that normally we refer to "TCP streams" and "UDP messages". Whatever Client library you use (e.g. Twisted), the underlying TCP connection is indepe...
0
1
0
0
2009-11-06T23:16:00.000
4
1
false
1,691,179
0
0
0
3
If I send two TCP messages, do I need to handle the case where the latter arrives before the former? Or is it guaranteed to arrive in the order I send it? I assume that this is not a Twisted-specific example, because it should conform to the TCP standard, but if anyone familiar with Twisted could provide a Twisted-spec...
Is TCP Guaranteed to arrive in order?
1,691,194
8
43
30,177
0
python,tcp,twisted,protocols
TCP is a stream, UDP is a message. You're mixing up terms. For TCP it is true that the stream will arrive in the same order as it was send. There are no distict messages in TCP, bytes appear as they arrive, interpreting them as messages is up to you.
0
1
0
0
2009-11-06T23:16:00.000
4
1
false
1,691,179
0
0
0
3
If I send two TCP messages, do I need to handle the case where the latter arrives before the former? Or is it guaranteed to arrive in the order I send it? I assume that this is not a Twisted-specific example, because it should conform to the TCP standard, but if anyone familiar with Twisted could provide a Twisted-spec...
Parsing output of apt-get install for progress bar
1,692,347
6
6
3,478
0
python,progress-bar,subprocess,popen,apt-get
Instead of parsing the output of the apt-get, you can use python-apt to install packages. AFAIK it also has modules for reporting the progress.
0
1
0
0
2009-11-07T05:18:00.000
2
1
false
1,692,082
0
0
0
1
I'm working on a simple GUI Python script to do some simple tasks on a system. Some of that work involves apt-get install to install some packages. While this is going on, I want to display a progress bar that should update with the progress of the download, using the little percentage shown in apt-get's interface in t...
Move or copy an entity to another kind
1,693,856
1
0
162
0
python,google-app-engine,indexing,archive,bigtable
Unless someone's written utilities for this kind of thing, the way to go is to read from one and write to the other kind!
0
1
0
0
2009-11-07T17:39:00.000
2
0.099668
false
1,693,815
0
0
1
2
Is there a way to move an entity to another kind in appengine. Say you have a kind defines, and you want to keep a record of deleted entities of that kind. But you want to separate the storage of live object and archived objects. Kinds are basically just serialized dicts in the bigtable anyway. And maybe you don't need...
Move or copy an entity to another kind
1,693,979
1
0
162
0
python,google-app-engine,indexing,archive,bigtable
No - once created, the kind is a part of the entity's immutable key. You need to create a new entity and copy everything across. One way to do this would be to use the low-level google.appengine.api.datastore interface, which treats entities as dicts.
0
1
0
0
2009-11-07T17:39:00.000
2
1.2
true
1,693,815
0
0
1
2
Is there a way to move an entity to another kind in appengine. Say you have a kind defines, and you want to keep a record of deleted entities of that kind. But you want to separate the storage of live object and archived objects. Kinds are basically just serialized dicts in the bigtable anyway. And maybe you don't need...
Environment on google Appengine
1,701,239
3
0
461
0
python,google-app-engine
To answer the actual question from the title of your post, assuming you're still wondering: to get environment variables, simple import os and the environment is available in os.environ.
0
1
0
0
2009-11-09T11:24:00.000
3
0.197375
false
1,700,441
0
0
1
1
does someone have an idea how to get the environment variables on Google-AppEngine ? I'm trying to write a simple Script that shall use the Client-IP (for Authentication) and a parameter (geturl or so) from the URL (for e.g. http://thingy.appspot.dom/index?geturl=www.google.at) I red that i should be able to get the C...
How to Execute a Python Script in Notepad++?
24,143,304
5
140
455,952
0
python,notepad++
I wish people here would post steps instead of just overall concepts. I eventually got the cmd /k version to work. The step-by-step instructions are: In NPP, click on the menu item: Run In the submenu, click on: Run In the Run... dialog box, in the field The Program to Run, delete any existing text and type in: cmd /K...
0
1
0
0
2009-11-09T17:41:00.000
21
0.047583
false
1,702,586
1
0
0
1
I prefer using Notepad++ for developing, How do I execute the files in Python through Notepad++?
Python library for Linux process management
1,705,099
6
14
10,686
0
python,linux,process
Checking the list of running processes is accomplished (even by core utilities like "ps") by looking at the contents of the /proc directory. As such, the library you're interested for querying running processes is the same as used for working with any other files and directories (i.e. sys or os, depending on the flavor...
0
1
0
0
2009-11-10T01:14:00.000
8
1
false
1,705,077
0
0
0
1
Through my web interface I would like to start/stop certain processes and determine whether a started process is still running. My existing website is Python based and running on a Linux server, so do you know of a suitable library that supports this functionality? Thanks
Python 2.6 on Debian Lenny. Where should the executable go?
1,711,271
0
0
6,560
0
python,linux,debian
Your safest bet is to put Python 2.6 in /opt (./configure --prefix=/opt), and modify /etc/profile so that /opt/bin is searched first.
0
1
0
0
2009-11-10T21:08:00.000
4
0
false
1,711,200
1
0
0
2
I am building python2.6 from source on Debian Lenny. ( ./configure make make altinstall ) I don't want it to conflict with anything existing, but I want it to be in the default search path for bash. Suggestions? (ps, I'm using a vm, so I can trash it and rebuild.)
Python 2.6 on Debian Lenny. Where should the executable go?
1,711,264
3
0
6,560
0
python,linux,debian
I strongly recommend you do one of these two options. Build a .deb package, and then install the .deb package; the installed then go in the usual places (/usr/bin/python26 for the main interpreter). Build from source, and install from source into /usr/local/bin. I think it is a very bad idea to start putting files in...
0
1
0
0
2009-11-10T21:08:00.000
4
0.148885
false
1,711,200
1
0
0
2
I am building python2.6 from source on Debian Lenny. ( ./configure make make altinstall ) I don't want it to conflict with anything existing, but I want it to be in the default search path for bash. Suggestions? (ps, I'm using a vm, so I can trash it and rebuild.)
Non-blocking file access with Twisted
44,355,634
2
27
8,205
0
python,twisted
The fdesc module might be useful for asynchronously talking to a socket or pipe, but when given an fd that refers to an ordinary filesystem file, it does blocking io (and via a rather odd interface at that). For disk io, fdesc is effectively snake oil; don't use it. As of May 2017, the only reasonable way to get async ...
0
1
0
0
2009-11-12T08:47:00.000
5
0.07983
false
1,720,816
0
0
0
2
I'm trying to figure out if there is a defacto pattern for file access using twisted. Lots of examples I've looked at (twisted.python.log, twisted.persisted.dirdbm, twisted.web.static) actually don't seem to worry about blocking for file access. It seems like there should be some obvious interface, probably inheriting...
Non-blocking file access with Twisted
1,720,836
-8
27
8,205
0
python,twisted
I'm not sure what you want to achieve. When you do logging, then Python will make sure (by the global interpreter log) that log messages from several threads go into the file one after the other. If you're concerned about blocking IO, then the OS adds default buffers for your files (usually 4KB), and you can pass a buf...
0
1
0
0
2009-11-12T08:47:00.000
5
-1
false
1,720,816
0
0
0
2
I'm trying to figure out if there is a defacto pattern for file access using twisted. Lots of examples I've looked at (twisted.python.log, twisted.persisted.dirdbm, twisted.web.static) actually don't seem to worry about blocking for file access. It seems like there should be some obvious interface, probably inheriting...
Is there any "remote console" for twisted server?
1,721,715
6
5
1,027
0
python,console,twisted
Take a look at twisted.manhole
0
1
0
1
2009-11-12T11:55:00.000
2
1
false
1,721,699
0
0
0
1
I am developing a twisted server. I need to control the memory usage. It is not a good idea to modify code, insert some memory logging command and restart the server. I think it is better to use a "remote console", so that I can type heapy command and see the response from the server directly. All I need is a remote co...
Is the first entry in sys.path supposed to represent the current working directory?
1,722,943
1
1
550
0
python,pythonpath,sys.path
You can get the current directory with os.getcwd().
0
1
0
0
2009-11-12T15:12:00.000
2
0.099668
false
1,722,901
1
0
0
1
I had always assumed that the first entry in sys.path by default was the current working directory. But as it turns out, on my system the first entry is the path on which the script resides. So if I'm executing a script that's in /usr/bin from /some/directory, the first entry in sys.path is /usr/bin. Is something mi...
Multiple programs using the same UDP port? Possible?
1,723,643
1
0
5,210
0
python,udp,communication,daemon,ports
I'm pretty sure this is possible on Linux; I don't know about other UNIXes. There are two ways to propagate a file descriptor from one process to another: When a process fork()s, the child inherits all the file descriptors of the parent. A process can send a file descriptor to another process over a "UNIX Domain Socke...
0
1
1
0
2009-11-12T15:22:00.000
2
0.099668
false
1,722,993
0
0
0
2
I currently have a small Python script that I'm using to spawn multiple executables, (voice chat servers), and in the next version of the software, the servers have the ability to receive heartbeat signals on the UDP port. (There will be possibly thousands of servers on one machine, ranging from ports 7878 and up) My p...
Multiple programs using the same UDP port? Possible?
1,723,017
2
0
5,210
0
python,udp,communication,daemon,ports
This isn't possible. What you'll have to do is have one UDP master program that handles all UDP communication over the one port, and communicates with your servers in another way (UDP on different ports, named pipes, ...)
0
1
1
0
2009-11-12T15:22:00.000
2
1.2
true
1,722,993
0
0
0
2
I currently have a small Python script that I'm using to spawn multiple executables, (voice chat servers), and in the next version of the software, the servers have the ability to receive heartbeat signals on the UDP port. (There will be possibly thousands of servers on one machine, ranging from ports 7878 and up) My p...
How to get process's grandparent id
1,728,361
0
7
14,912
0
python,linux,process,subprocess
I do not think you can do this portably in the general case. You need to get this information from the process list (e.g. through the ps command), which is obtained in a system-specific way.
0
1
0
0
2009-11-13T10:13:00.000
7
0
false
1,728,330
0
0
0
1
How can i get process id of the current process's parent? In general given a process id how can I get its parent process id? e.g. os.getpid() can be used to get the proccess id, and os.getppid() for the parent, how do I get grandparent, My target is linux(ubuntu) so platform specific answers are ok.
Twisted Spread suitable for multiplayer racing sim?
1,732,990
5
2
708
0
python,networking,udp,twisted,multiplayer
It's almost certainly a reasonable protocol to start with. Remember the cardinal rule of optimization: don't do it. Working with any TCP-based protocol is going to be considerably easier than working with any UDP-based protocol. This is initially much more important to the success of your project than whether it tak...
0
1
0
0
2009-11-14T01:49:00.000
2
1.2
true
1,732,957
0
0
0
1
Do you think that Twisted Spread may be suitable (in terms of performance) for a multiplayer racing simulator? The rest of the application is based on Python-Ogre. Can Perspective Broker run upon (reliable?) UDP?
ubuntu9.10 : how to use python's lib-dynload and site-packages directories?
1,733,409
1
3
10,075
0
python,ubuntu,installation
Sounds like they're an accident from some package(s) you have installed. The Python version in use determines the locations searched to find installed Python packages/modules, and the "system version" of Python in Ubuntu 9.10 is 2.6, so that's what practically everything should be using. If you were to install the pyt...
0
1
0
0
2009-11-14T05:23:00.000
4
0.049958
false
1,733,364
1
0
0
1
In ubuntu 9.10, in usr/lib/ there are the directories python2.4, python2.5, python2.6 and python3.0 Only python 2.6 is actually working. python2.4 has only a lib-dynload directory, python2.5 has only lib-dynload and site-packages, python3.0 has only a dist-packages directory. Now i'm wondering what is the idea behin...
Setting Python Interpreter in Eclipse (Mac)
1,735,193
7
10
20,985
0
python,eclipse,macos
Running $which python should help locate your Python installation.
0
1
0
0
2009-11-14T18:18:00.000
4
1
false
1,735,109
1
0
0
2
How do I direct Eclipse to the Python interpreter on my Mac? I've looked in Library which contains the directory 'Python' then '2.3' and '2.5', however they contain nothing except 'Site-packages' - Which is weird considering I can go into the terminal and type python. I then installed the latest 2.6 version with packag...
Setting Python Interpreter in Eclipse (Mac)
1,735,148
7
10
20,985
0
python,eclipse,macos
An alias to the python interpreter was likely installed into /usr/local/bin. So, to invoke python2.6, type /usr/local/bin/python2.6 or, most likely, just python2.6. If you want python to invoke python2.6, try rearranging your $PATH so that /usr/local/bin precedes /usr/bin.
0
1
0
0
2009-11-14T18:18:00.000
4
1.2
true
1,735,109
1
0
0
2
How do I direct Eclipse to the Python interpreter on my Mac? I've looked in Library which contains the directory 'Python' then '2.3' and '2.5', however they contain nothing except 'Site-packages' - Which is weird considering I can go into the terminal and type python. I then installed the latest 2.6 version with packag...
Native Python Editor for Mac?
4,642,775
0
2
9,940
0
python,macos,ide,editor,python-idle
going to vote for Fraise. handles almost anything, has indentations, and uses color! its free too.
0
1
0
0
2009-11-15T03:19:00.000
12
0
false
1,736,451
1
0
0
6
I'm currently using IDLE, its decent, but I'd like to know if there're better lightweight IDEs built especially for Mac — free or commercial.
Native Python Editor for Mac?
1,736,831
0
2
9,940
0
python,macos,ide,editor,python-idle
vim, emacs, BBEdit, WingIDE, or my favorite - eclipse (although, I don't think this is very lightweight)
0
1
0
0
2009-11-15T03:19:00.000
12
0
false
1,736,451
1
0
0
6
I'm currently using IDLE, its decent, but I'd like to know if there're better lightweight IDEs built especially for Mac — free or commercial.
Native Python Editor for Mac?
2,854,788
0
2
9,940
0
python,macos,ide,editor,python-idle
I would recommend you to look at Aptana(it's more attractive then Eclipse for me)+PyDev or PyCarm. I use TextMate too, but those are easy for debug.
0
1
0
0
2009-11-15T03:19:00.000
12
0
false
1,736,451
1
0
0
6
I'm currently using IDLE, its decent, but I'd like to know if there're better lightweight IDEs built especially for Mac — free or commercial.
Native Python Editor for Mac?
3,432,322
0
2
9,940
0
python,macos,ide,editor,python-idle
I use FRAISE (free) it is simple and useful, auto indentation, colorize, auto completion, shell.
0
1
0
0
2009-11-15T03:19:00.000
12
0
false
1,736,451
1
0
0
6
I'm currently using IDLE, its decent, but I'd like to know if there're better lightweight IDEs built especially for Mac — free or commercial.
Native Python Editor for Mac?
1,736,465
1
2
9,940
0
python,macos,ide,editor,python-idle
There is a commercial one - Textmate. Most of the good free editors are cross-platform (if you are ok with it, I'd recommend EditRa - but it doesn't work properly under 10.6 yet, because of some bugs in wxPython).
0
1
0
0
2009-11-15T03:19:00.000
12
0.016665
false
1,736,451
1
0
0
6
I'm currently using IDLE, its decent, but I'd like to know if there're better lightweight IDEs built especially for Mac — free or commercial.
Native Python Editor for Mac?
7,764,682
0
2
9,940
0
python,macos,ide,editor,python-idle
check out Sublime Text 2 Alpha. seriously awesome.
0
1
0
0
2009-11-15T03:19:00.000
12
0
false
1,736,451
1
0
0
6
I'm currently using IDLE, its decent, but I'd like to know if there're better lightweight IDEs built especially for Mac — free or commercial.
Compress data before storage on Google App Engine
2,125,539
0
1
2,545
0
python,google-app-engine,compression,gzip,zlib
You can store up to 10Mb with a list of Blobs. Search for google file service. It's much more versatile than BlobStore in my opinion, since I just started using BlobStore Api yesterday and I'm still figuring out if it is possible to access the data bytewise.. as in changing doc to pdf, jpeg to gif.. You can storage Bl...
0
1
0
0
2009-11-16T00:55:00.000
5
0
false
1,739,543
0
0
1
2
I im trying to store 30 second user mp3 recordings as Blobs in my app engine data store. However, in order to enable this feature (App Engine has a 1MB limit per upload) and to keep the costs down I would like to compress the file before upload and decompress the file every time it is requested. How would you suggest ...
Compress data before storage on Google App Engine
1,739,598
2
1
2,545
0
python,google-app-engine,compression,gzip,zlib
"Compressing before upload" implies doing it in the user's browser -- but no text in your question addresses that! It seems to be about compression in your GAE app, where of course the data will only be after the upload. You could do it with a Firefox extension (or other browsers' equivalents), if you can develop tho...
0
1
0
0
2009-11-16T00:55:00.000
5
1.2
true
1,739,543
0
0
1
2
I im trying to store 30 second user mp3 recordings as Blobs in my app engine data store. However, in order to enable this feature (App Engine has a 1MB limit per upload) and to keep the costs down I would like to compress the file before upload and decompress the file every time it is requested. How would you suggest ...
Unable to unpickle a file on Mac that was pickled on Windows
1,748,972
5
3
1,555
0
python,windows,macos,pickle
Pickle with the newest protocol version and open the files in binary mode in all cases. That should solve the problem.
0
1
0
0
2009-11-17T13:40:00.000
2
1.2
true
1,748,958
1
0
0
2
I've got a simple class that I am pickling(dumping) to a file. On OS X this works fine, and on Windows this works fine. However, while on windows I can load/unpickle the object fine - when windows then pickles this file and saves it back to disk, it becomes unreadable on OS X (although in Windows it still behaves as no...
Unable to unpickle a file on Mac that was pickled on Windows
1,748,998
3
3
1,555
0
python,windows,macos,pickle
It will be line endings - if you are using ASCII pickle open file in ascii mode 'r' or 'w' - if you are using a binary pickle open in binary mode 'rb' 'wb'. From the docstring: The default protocol is 0, to be backwards compatible. (Protocol 0 is the only protocol that can be written to a file opened in t...
0
1
0
0
2009-11-17T13:40:00.000
2
0.291313
false
1,748,958
1
0
0
2
I've got a simple class that I am pickling(dumping) to a file. On OS X this works fine, and on Windows this works fine. However, while on windows I can load/unpickle the object fine - when windows then pickles this file and saves it back to disk, it becomes unreadable on OS X (although in Windows it still behaves as no...
Restarting a self-updating python script
1,750,798
2
47
41,683
0
python,auto-update
The cleanest solution is a separate update script! Run your program inside it, report back (when exiting) that a new version is available. This allows your program to save all of its data, the updater to apply the update, and run the new version, which then loads the saved data and continues. To the user this can be ...
0
1
0
0
2009-11-17T18:16:00.000
8
0.049958
false
1,750,757
1
0
0
1
I have written a script that will keep itself up to date by downloading the latest version from a website and overwriting the running script. I am not sure what the best way to restart the script after it has been updated. Any ideas? I don't really want to have a separate update script. oh and it has to work on both li...
Checking files retrieved by Twisted's FTPClient.retrieveFile method for completeness
1,757,848
4
3
1,008
0
python,ftp,client,twisted
There are a couple unit tests for behavior in this area. twisted.test.test_ftp.FTPClientTestCase.test_failedRETR is the most directly relevant one. It covers the case where the control and data connections are lost while a file transfer is in progress. It seems to me that test coverage in this area could be significan...
0
1
0
0
2009-11-18T16:32:00.000
1
1.2
true
1,757,276
0
0
0
1
I'm writing a custom ftp client to act as a gatekeeper for incoming multimedia content from subcontractors hired by one of our partners. I chose twisted because it allows me to parse the file contents before writing the files to disk locally, and I've been looking for occasion to explore twisted anyway. I'm using 'twis...
python prompt with a bash like interface
1,758,845
6
2
1,113
0
python
If you compile python with readline support, the REPL environment should do this for you.
0
1
0
0
2009-11-18T20:27:00.000
4
1
false
1,758,819
1
0
0
1
I am using the python prompt to practice some regular expressions. I was wondering if there was a way to use the up/down arrows (like bash) to cycle through the old commands typed. I know its possible since it works on python on cygwin/windows. thanks
Is there a sendKey for Mac in Python?
1,770,681
0
19
19,837
0
python,macos,sendkeys
Maybe you could run an OSA script (man osascript) from Python, for instance, and drive the application?
0
1
0
0
2009-11-20T13:04:00.000
5
0
false
1,770,312
0
0
0
1
In Mac 10.6, I want to cause an active application to become de-active, or minimized by Python I know I could use sendKey in Windows with Python, then what about in Mac?
reactor.iterate seems to block a program with Py2exe
1,770,870
1
1
116
0
python,twisted,py2exe
The typical use of the reactor is not to call reactor.iterate. It's hard to say why exactly you're getting the behavior you are without seeing your program, but for a wild guess, I'd say switching to reactor.run might help.
0
1
0
0
2009-11-20T14:25:00.000
1
1.2
true
1,770,754
1
0
0
1
I'm currently using an application in python which works quite well but when I'm converting it with py2exe, the application seems to be suspended at the first "reactor.iterate" Each time I press Ctrl+C to stop the application, the error is always the same and the application seems to be bloqued on a "reactor.iterate(4)...
Python programs coexisting on Windows
1,779,645
1
3
512
0
python,windows
One solution would be to craft a batch file that invokes the correct interpreter for a given application. THis way, you can install additional interpreters in separate folders. Probably not perfect but it works.
0
1
0
0
2009-11-22T19:02:00.000
6
0.033321
false
1,779,630
1
0
0
3
I'm looking for a way to let multiple Python programs coexist on the same Windows machine. Here's the problem: suppose program A needs Python 2.5, B needs 2.6, C needs 3, and each of them needs its own version of Qt, Wx or whatever other modules or whatever. Trying to install all these dependencies on the same machine ...
Python programs coexisting on Windows
1,779,665
0
3
512
0
python,windows
write a python script that mimics the way unix shells handle scirpts -- look at the first line and see if it matches #!(name-of-shell). Then have your python script exec that interpreter and feed it the rest of its arguments. Then, associate .py with your script.
0
1
0
0
2009-11-22T19:02:00.000
6
0
false
1,779,630
1
0
0
3
I'm looking for a way to let multiple Python programs coexist on the same Windows machine. Here's the problem: suppose program A needs Python 2.5, B needs 2.6, C needs 3, and each of them needs its own version of Qt, Wx or whatever other modules or whatever. Trying to install all these dependencies on the same machine ...
Python programs coexisting on Windows
1,779,655
2
3
512
0
python,windows
Use batch files to run scripts, write in notepad for example: c:\python26\python.exe C:\Script_B\B.py and save it as runB.bat (or anything .bat). It will run with interpreter in c:\python26\python.exe file specified after a whitespace.
0
1
0
0
2009-11-22T19:02:00.000
6
0.066568
false
1,779,630
1
0
0
3
I'm looking for a way to let multiple Python programs coexist on the same Windows machine. Here's the problem: suppose program A needs Python 2.5, B needs 2.6, C needs 3, and each of them needs its own version of Qt, Wx or whatever other modules or whatever. Trying to install all these dependencies on the same machine ...
Python : fork and exec a process to run on different terminal
1,794,679
1
1
1,575
0
python,process
If you want "real" (pseudo-;-) terminals, and are using X11 (almost every GUI interface on Linux does;-), you could exec xterm -e python node.py instead of just python node.py -- substitute for xterm whatever terminal emulator program you prefer, of course (I'm sure they all have command-line switches equivalent to goo...
0
1
0
0
2009-11-25T04:04:00.000
2
1.2
true
1,794,536
0
0
0
1
I am trying to simulate a a network consisting of several clients and servers. I have written node.py which contains client-server code. I want to run multiple instances node.py. But I don't want to do it manually so I have written another file spawn.py which spawns multiple instances of node.py using fork and exec. Ho...
Launching default application for given type of file, OS X
1,798,364
1
2
576
0
python,subprocess
Do you know about the open command in Mac OS X? I think you can solve your problem by calling it from Python. man open for details: The open command opens a file (or a directory or URL), just as if you had double-clicked the file's icon. If no application name is specified, the default application as determined via Lau...
0
1
0
0
2009-11-25T16:56:00.000
3
0.066568
false
1,798,351
0
0
1
2
I'm writing a python script that generates html file. Every time I run this script I'd like at the end to open default system browser for this file. It's all in OS X environment. What python code can launch Safari/Firefox/whatever is system default html viewer and open given file? subprocess.call doesn't seem to do the...
Launching default application for given type of file, OS X
1,799,054
0
2
576
0
python,subprocess
import ic ic.launchurl('file:///somefile.html')
0
1
0
0
2009-11-25T16:56:00.000
3
0
false
1,798,351
0
0
1
2
I'm writing a python script that generates html file. Every time I run this script I'd like at the end to open default system browser for this file. It's all in OS X environment. What python code can launch Safari/Firefox/whatever is system default html viewer and open given file? subprocess.call doesn't seem to do the...
What is the performance cost of named keys or "pre-generated" keys in Google App Engine?
1,805,774
4
2
198
0
python,google-app-engine
There is no intrinsic penalty to using a key name instead of an auto-generated ID, except the overhead of a (potentially) longer key on the entity and any ReferenceProperties that reference it. In certain cases, in fact, using auto-allocated IDs can have a performance penalty: If you insert new entities at a very high ...
0
1
0
0
2009-11-26T20:38:00.000
1
1.2
true
1,805,555
0
0
1
1
If you used named keys in Google App Engine, does this incur any additional cost? Put another way, is it any more expensive to create a new entity with a named key rather than a randomly generated id? In a similar line of reasoning, I note that you can ask Google App Engine to give you a set of keys that will not be us...
How to safely write to a file?
1,812,351
4
21
9,770
0
python,windows,file
The standard solution is this. Write a new file with a similar name. X.ext# for example. When that file has been closed (and perhaps even read and checksummed), then you two two renames. X.ext (the original) to X.ext~ X.ext# (the new one) to X.ext (Only for the crazy paranoids) call the OS sync function to force d...
0
1
0
0
2009-11-28T09:46:00.000
8
0.099668
false
1,812,115
1
0
0
2
Imagine you have a library for working with some sort of XML file or configuration file. The library reads the whole file into memory and provides methods for editing the content. When you are done manipulating the content you can call a write to save the content back to file. The question is how to do this in a safe w...
How to safely write to a file?
1,812,604
17
21
9,770
0
python,windows,file
If you see Python's documentation, it clearly mentions that os.rename() is an atomic operation. So in your case, writing data to a temporary file and then renaming it to the original file would be quite safe. Another way could work like this: let original file be abc.xml create abc.xml.tmp and write new data to it re...
0
1
0
0
2009-11-28T09:46:00.000
8
1.2
true
1,812,115
1
0
0
2
Imagine you have a library for working with some sort of XML file or configuration file. The library reads the whole file into memory and provides methods for editing the content. When you are done manipulating the content you can call a write to save the content back to file. The question is how to do this in a safe w...
Global disk resource becomes unavailable
1,814,406
1
0
65
0
python,linux,fileserver,flock
If this happens intermittently, you might just want to try waiting a short period and retrying. Other than that... log the error and fail. Maybe throw an exception that someone higher up can catch and deal with more gracefully.
0
1
0
0
2009-11-29T02:00:00.000
1
0.197375
false
1,814,393
0
0
0
1
If I've got a global disk resource (mount point on an isilon file server) that multiple servers use to access a lock file. What is a good way to handle the situation if that global disk becomes unavailable and the servers can't access the global lock file? Thanks, Doug
why Ghost Process appears after kill -9
1,853,165
0
1
845
0
python,process,kill
Zombie processes are actually just an entry in the process table. They do not run, they don't consume memory; the entry just stays because the parent hasn't checked their exit code. You can either do a double fork as Gonzalo suggests, or you can filter out all ps lines with a Z in the S column.
0
1
0
0
2009-12-02T02:49:00.000
3
0
false
1,830,370
0
0
0
2
In my Python script, I first launch a subprocess by subprocess.Popen(). Then later on, I want to kill that subprocess by kill -9 Pid. What I found is that after the kill is executed, the subprocess is "stopped" because the GUI window of that process disappeared immediately. But when I perform a "ps aux" right after the...
why Ghost Process appears after kill -9
1,830,395
0
1
845
0
python,process,kill
I think -9 signal lets the process to try to handle kill and spend some time housekeeping. You can try just kill the process without signal. Edit: oh, its actually -15 signal, that lets process die gracefully. never mind.
0
1
0
0
2009-12-02T02:49:00.000
3
0
false
1,830,370
0
0
0
2
In my Python script, I first launch a subprocess by subprocess.Popen(). Then later on, I want to kill that subprocess by kill -9 Pid. What I found is that after the kill is executed, the subprocess is "stopped" because the GUI window of that process disappeared immediately. But when I perform a "ps aux" right after the...
Python, PowerShell, or Other?
1,835,086
46
32
44,901
0
python,powershell,scripting
Python works as a great, all-purpose tool if you're looking to replace CMD and BAT scripts on your Windows boxes, and can also be written to run scripts on your (L)inux boxes, too. It's a great, flexible language and can handle many tasks you throw at it. That being said, PowerShell is an amazingly versatile tool for a...
0
1
0
1
2009-12-02T18:26:00.000
8
1
false
1,834,850
1
0
0
6
What are the advantages of Python, PowerShell, and other scripting environments? We would like to standardize our scripting and are currently using bat and cmd files as the standard. I think Python would be a better option than these, but am also researching PowerShell and other scripting tools. The scripts would be ...
Python, PowerShell, or Other?
1,836,471
3
32
44,901
0
python,powershell,scripting
If all you do is spawning a lot of system specific programs with no or little programming logic behind then OS specific shell might be a better choice than a full general purpose programming language.
0
1
0
1
2009-12-02T18:26:00.000
8
0.07486
false
1,834,850
1
0
0
6
What are the advantages of Python, PowerShell, and other scripting environments? We would like to standardize our scripting and are currently using bat and cmd files as the standard. I think Python would be a better option than these, but am also researching PowerShell and other scripting tools. The scripts would be ...
Python, PowerShell, or Other?
1,835,112
2
32
44,901
0
python,powershell,scripting
I find it sad no one yet mentioend good ol' Perl.
0
1
0
1
2009-12-02T18:26:00.000
8
0.049958
false
1,834,850
1
0
0
6
What are the advantages of Python, PowerShell, and other scripting environments? We would like to standardize our scripting and are currently using bat and cmd files as the standard. I think Python would be a better option than these, but am also researching PowerShell and other scripting tools. The scripts would be ...
Python, PowerShell, or Other?
1,834,895
2
32
44,901
0
python,powershell,scripting
The questions is kind of vague, but Python is much more portable than PowerShell; however, Python isn't that prevalent on Windows. But on the other hand, I don't believe PowerShell scripts will work on a Windows machine that doesn't have PowerShell. Meaning they may not work in the old fashioned cmd shell. I think y...
0
1
0
1
2009-12-02T18:26:00.000
8
0.049958
false
1,834,850
1
0
0
6
What are the advantages of Python, PowerShell, and other scripting environments? We would like to standardize our scripting and are currently using bat and cmd files as the standard. I think Python would be a better option than these, but am also researching PowerShell and other scripting tools. The scripts would be ...
Python, PowerShell, or Other?
1,836,342
20
32
44,901
0
python,powershell,scripting
We would like to standardize our scripting and are currently using bat and cmd files as the standard. It sounds like Windows is your predominate environment. If so, PowerShell would be much better than Python. PowerShell is included with Windows Server 2008. No need to deploy/install Python runtime on every new ser...
0
1
0
1
2009-12-02T18:26:00.000
8
1
false
1,834,850
1
0
0
6
What are the advantages of Python, PowerShell, and other scripting environments? We would like to standardize our scripting and are currently using bat and cmd files as the standard. I think Python would be a better option than these, but am also researching PowerShell and other scripting tools. The scripts would be ...
Python, PowerShell, or Other?
1,834,979
2
32
44,901
0
python,powershell,scripting
One advantage to Python is the availability of third-party libraries and an extensive built-in standard library. You can do a lot of powerful operations quickly and easily with Python on a variety of operating systems and environments. That's one reason we use Python here at the office not only as a scripting language ...
0
1
0
1
2009-12-02T18:26:00.000
8
0.049958
false
1,834,850
1
0
0
6
What are the advantages of Python, PowerShell, and other scripting environments? We would like to standardize our scripting and are currently using bat and cmd files as the standard. I think Python would be a better option than these, but am also researching PowerShell and other scripting tools. The scripts would be ...
Need a zip of Python 2.6 for windows
1,835,980
8
1
1,012
0
python,zip
How would it overtake 2.5? You can install both in parallel, just make sure that you unselect the option to "Register Extensions" during the install of 2.6. I have several Python installations on my PC in parallel, one of them my "standard" one that I expect to run when I doubleclick on a .py file, and the other one to...
0
1
0
0
2009-12-02T21:27:00.000
2
1.2
true
1,835,930
1
0
0
2
Not the source codes, thats the only thing i seem to find. I can't install py2.6 because it would overtake 2.5 and cause mayor mess in my pc.
Need a zip of Python 2.6 for windows
1,836,803
2
1
1,012
0
python,zip
I have Pythons 2.3, 2.4, 2.5, 2.6, and 3.1 all installed on my PC. Download the .msi from python.org, and install it.
0
1
0
0
2009-12-02T21:27:00.000
2
0.197375
false
1,835,930
1
0
0
2
Not the source codes, thats the only thing i seem to find. I can't install py2.6 because it would overtake 2.5 and cause mayor mess in my pc.
python web app logging through pipe? (performance concerned)
1,839,366
1
0
514
0
python,logging,pipe
Pipes are one of the fastest I/O mechanisms available. It's just a shared buffer. Nothing more. If the receiving end of your pipe is totally overwhelmed, you may have an issue. But you have no evidence of that right now. If you have 10's of processes started by FastCGI, each can have their own independent log file...
0
1
0
1
2009-12-03T11:28:00.000
1
1.2
true
1,839,348
0
0
1
1
I'm writing a web app using python with web.py, and I want to implement my own logging system. I'd like to log detailed information about each request that come to python (static files are handled by web servers). Currently I'm thinking about writing the logs to a pipe. On the other side, there should be cronolog. My m...
Hashing Multiple Files
1,847,365
1
3
4,430
0
python,perl,bash,hash,batch-processing
Hm, interesting problem. Try the following (the mktest function is just for testing -- TDD for bash! :) Edit: Added support for whirlpool hashes. code cleanup better quoting of filenames changed array-syntax for test part-- should now work with most korn-like shells. Note that pdksh does not support :-based parameter ...
0
1
0
1
2009-12-03T18:00:00.000
13
0.015383
false
1,841,737
1
0
0
1
Problem Specification: Given a directory, I want to iterate through the directory and its non-hidden sub-directories,  and add a whirlpool hash into the non-hidden file's names. If the script is re-run it would would replace an old hash with a new one. <filename>.<extension>   ==>  <filename>.<a-whirlpool-hash>.<exten...
Python Performance on Windows
1,845,290
1
13
9,943
0
python,windows,performance,macos,mercurial
I run Python locally on Windows XP and 7 as well as OSX on my Macbook. I've seen no noticable performance differences in the command line interpreter, wx widget apps run the same, and Django apps also perform virtually identically. One thing I noticed at work was that the Kaspersky virus scanner tended to slow the pyt...
0
1
0
0
2009-12-03T20:44:00.000
6
0.033321
false
1,842,798
1
0
0
5
Is Python generally slower on Windows vs. a *nix machine? Python seems to blaze on my Mac OS X machine whereas it seems to run slower on my Window's Vista machine. The machines are similar in processing power and the vista machine has 1GBs more memory. I particularly notice this in Mercurial but I figure this may sim...
Python Performance on Windows
1,845,271
1
13
9,943
0
python,windows,performance,macos,mercurial
Maybe the python has more depend on a lot of files open (import different modules). Windows doesn't handle file open as efficiently as Linux. Or maybe Linux probably have more utilities depend on python and python scripts/modules are more likely to be buffered in the system cache.
0
1
0
0
2009-12-03T20:44:00.000
6
0.033321
false
1,842,798
1
0
0
5
Is Python generally slower on Windows vs. a *nix machine? Python seems to blaze on my Mac OS X machine whereas it seems to run slower on my Window's Vista machine. The machines are similar in processing power and the vista machine has 1GBs more memory. I particularly notice this in Mercurial but I figure this may sim...
Python Performance on Windows
37,372,277
0
13
9,943
0
python,windows,performance,macos,mercurial
Interestingly I ran a direct comparison of a popular Python app on a Windows 10 x64 Machine (low powered admittedly) and a Ubuntu 14.04 VM running on the same machine. I have not tested load speeds etc, but am just looking at processor usage between the two. To make the test fair, both were fresh installs and I duplica...
0
1
0
0
2009-12-03T20:44:00.000
6
0
false
1,842,798
1
0
0
5
Is Python generally slower on Windows vs. a *nix machine? Python seems to blaze on my Mac OS X machine whereas it seems to run slower on my Window's Vista machine. The machines are similar in processing power and the vista machine has 1GBs more memory. I particularly notice this in Mercurial but I figure this may sim...
Python Performance on Windows
1,843,044
1
13
9,943
0
python,windows,performance,macos,mercurial
No real numbers here but it certainly feels like the start up time is slower on Windows platforms. I regularly switch between Ubuntu at home and Windows 7 at work and it's an order of magnitude faster starting up on Ubuntu, despite my work machine being at least 4x the speed. As for runtime performance, it feels about...
0
1
0
0
2009-12-03T20:44:00.000
6
0.033321
false
1,842,798
1
0
0
5
Is Python generally slower on Windows vs. a *nix machine? Python seems to blaze on my Mac OS X machine whereas it seems to run slower on my Window's Vista machine. The machines are similar in processing power and the vista machine has 1GBs more memory. I particularly notice this in Mercurial but I figure this may sim...
Python Performance on Windows
1,846,141
0
13
9,943
0
python,windows,performance,macos,mercurial
With the OS and network libraries, I can confirm slower performance on Windows, at least for versions =< 2.6. I wrote a CLI podcast-fetcher script which ran great on Ubuntu, but then wouldn't download anything faster than about 80 kB/s (where ~1.6 MB/s is my usual max) on either XP or 7. I could partially correct t...
0
1
0
0
2009-12-03T20:44:00.000
6
0
false
1,842,798
1
0
0
5
Is Python generally slower on Windows vs. a *nix machine? Python seems to blaze on my Mac OS X machine whereas it seems to run slower on my Window's Vista machine. The machines are similar in processing power and the vista machine has 1GBs more memory. I particularly notice this in Mercurial but I figure this may sim...
Is pickle file of python cross-platform?
1,850,806
36
21
24,001
0
python,file-io,pickle
Python's pickle is perfectly cross-platform. This is likely due to EOL (End-Of-Line) differences between Windows and Linux. Make sure to open your pickle files in binary mode both when writing them and when reading them, using open()'s "wb" and "rb" modes respectively. Note: Passing pickles between different versions o...
0
1
0
0
2009-12-04T20:39:00.000
6
1.2
true
1,849,523
1
0
0
2
I have created a small python script of mine. I saved the pickle file on Linux and then used it on windows and then again used it back on Linux but now that file is not working on Linux but it is working perfectly on windows. Is is so that python is coss-platform but the pickle file is not. Is there any solution to th...
Is pickle file of python cross-platform?
1,849,549
1
21
24,001
0
python,file-io,pickle
You could use json instead of pickle. If it can save your data, you know it's cross platform.
0
1
0
0
2009-12-04T20:39:00.000
6
0.033321
false
1,849,523
1
0
0
2
I have created a small python script of mine. I saved the pickle file on Linux and then used it on windows and then again used it back on Linux but now that file is not working on Linux but it is working perfectly on windows. Is is so that python is coss-platform but the pickle file is not. Is there any solution to th...
How to auto-run a script
1,854,777
-3
4
35,644
0
python,autorun
You want the script to download the weather information online and output the clothes based on your predefined rules? If this is the case, use urllib to download the page and do some ad hoc parsing over the downloaded html page to get the whether information. And write your logic using nested IF THEN ELSE blocks.
0
1
0
0
2009-12-06T08:10:00.000
5
-0.119427
false
1,854,718
0
0
0
3
I created a script that will tell me what to wear in the morning based on the weather (i.e. rain slicker if it will rain, heavy jacket if it will be cold, etc). I have fairly basic programming experience with python and the script works perfectly, but I want to be able to create a file that I can just double-click fro...
How to auto-run a script
34,125,858
0
4
35,644
0
python,autorun
Use a batch file to make it automatic Example : 1. Open Notepad -> type the following. This one's for Windows..It might give you a hint :start C:\Python34\python.exe(your python file location)Your *.py file location. :end Save this with a *.bat extension That's it ..you can configure more on this batch,I guess b...
0
1
0
0
2009-12-06T08:10:00.000
5
0
false
1,854,718
0
0
0
3
I created a script that will tell me what to wear in the morning based on the weather (i.e. rain slicker if it will rain, heavy jacket if it will be cold, etc). I have fairly basic programming experience with python and the script works perfectly, but I want to be able to create a file that I can just double-click fro...
How to auto-run a script
51,091,871
-2
4
35,644
0
python,autorun
In Linux/unix based OS , add #!/usr/bin/python3 line on top of your script file with extension .py , if you have python version 3. Or change it to the version installed in the machine Further , make the file executable by sudo chmod +x <fileName> for windows, add windows python path and make the file executable
0
1
0
0
2009-12-06T08:10:00.000
5
-0.07983
false
1,854,718
0
0
0
3
I created a script that will tell me what to wear in the morning based on the weather (i.e. rain slicker if it will rain, heavy jacket if it will be cold, etc). I have fairly basic programming experience with python and the script works perfectly, but I want to be able to create a file that I can just double-click fro...
Google App Engine Application Extremely slow
2,908,765
3
17
8,372
0
python,django,google-app-engine
I used pingdom for obvious reasons - no cold starts is a bonus. Of course the customers will soon come flocking and it will be a non-issue
0
1
0
0
2009-12-06T08:58:00.000
8
0.07486
false
1,854,821
0
0
1
5
I created a Hello World website in Google App Engine. It is using Django 1.1 without any patch. Even though it is just a very simple web page, it takes long time and often it times out. Any suggestions to solve this? Note: It is responding fast after the first call.
Google App Engine Application Extremely slow
1,856,432
3
17
8,372
0
python,django,google-app-engine
I encounteres the same with pylons based app. I have the initial page server as static, and have a dummy ajax call in it to bring the app up, before the user types in credentials. It is usually enough to avoid a lengthy response... Just an idea that you might use before you actually have a million users ;).
0
1
0
0
2009-12-06T08:58:00.000
8
0.07486
false
1,854,821
0
0
1
5
I created a Hello World website in Google App Engine. It is using Django 1.1 without any patch. Even though it is just a very simple web page, it takes long time and often it times out. Any suggestions to solve this? Note: It is responding fast after the first call.
Google App Engine Application Extremely slow
1,854,829
4
17
8,372
0
python,django,google-app-engine
If it's responding quickly after the first request, it's probably just a case of getting the relevant process up and running. Admittedly it's slightly surprising that it takes so long that it times out. Is this after you've updated the application and verified that the AppEngine dashboard shows it as being ready? "Firs...
0
1
0
0
2009-12-06T08:58:00.000
8
0.099668
false
1,854,821
0
0
1
5
I created a Hello World website in Google App Engine. It is using Django 1.1 without any patch. Even though it is just a very simple web page, it takes long time and often it times out. Any suggestions to solve this? Note: It is responding fast after the first call.
Google App Engine Application Extremely slow
1,854,875
14
17
8,372
0
python,django,google-app-engine
This is a horrible suggestion but I'll make it anyway: Build a little client application or just use wget with cron to periodically access your app, maybe once every 5 minutes or so. That should keep Google from putting it into a dormant state. I say this is a horrible suggestion because it's a waste of resources and a...
0
1
0
0
2009-12-06T08:58:00.000
8
1.2
true
1,854,821
0
0
1
5
I created a Hello World website in Google App Engine. It is using Django 1.1 without any patch. Even though it is just a very simple web page, it takes long time and often it times out. Any suggestions to solve this? Note: It is responding fast after the first call.
Google App Engine Application Extremely slow
1,856,888
4
17
8,372
0
python,django,google-app-engine
One more tip which might increase the response time. Enabling billing does increase the quotas, and, to my personal experience, increase the overall response of an application as well. Probably because of the higher priority for billing-enabled applications google has. For instance, an app with billing disabled, can se...
0
1
0
0
2009-12-06T08:58:00.000
8
0.099668
false
1,854,821
0
0
1
5
I created a Hello World website in Google App Engine. It is using Django 1.1 without any patch. Even though it is just a very simple web page, it takes long time and often it times out. Any suggestions to solve this? Note: It is responding fast after the first call.
Proper way to implement a Direct Connect client in Twisted?
1,857,145
3
3
1,176
0
python,twisted,p2p
Without knowing all the details of the protocol, I would still recommend using a single reactor -- a reactor scales quite well (especially advanced ones such as PollReactor) and this way you will avoid the overhead connected with threads (that's how Twisted and other async systems get their fundamental performance boos...
0
1
1
0
2009-12-06T22:10:00.000
1
1.2
true
1,856,786
0
0
0
1
I'm working on writing a Python client for Direct Connect P2P networks. Essentially, it works by connecting to a central server, and responding to other users who are searching for files. Occasionally, another client will ask us to connect to them, and they might begin downloading a file from us. This is a direct conne...
Using AppEngine XMPP for Client Notifications
1,859,664
0
1
1,077
0
python,web-services,google-app-engine,xmpp
In that situation, I would perform ajax calls every 5 minutes in example to check it. It's easy to implement and the data exchanged can be reduced to the max (taking advantage of "fast query/response" bonifications of google-app). Regards.
0
1
0
0
2009-12-07T12:12:00.000
3
0
false
1,859,634
0
0
1
2
I've been looking for a way to tell clients about expired objects and AppEngine's XMPP implementation seems really interesting because it's scalable, should be reliable and can contain up to 100kb of data. But as I understand it, before a client can listen to messages, he should have a gmail account. That's very impra...
Using AppEngine XMPP for Client Notifications
1,859,647
1
1
1,077
0
python,web-services,google-app-engine,xmpp
No this isn't true: you can have the AppEngine robot as contact over any Jabber/XMPP based networks. Unless you are talking about the need for a GMAIL account to create an AppEngine robot... in which case YES you need to have a Google account.
0
1
0
0
2009-12-07T12:12:00.000
3
1.2
true
1,859,634
0
0
1
2
I've been looking for a way to tell clients about expired objects and AppEngine's XMPP implementation seems really interesting because it's scalable, should be reliable and can contain up to 100kb of data. But as I understand it, before a client can listen to messages, he should have a gmail account. That's very impra...
How do I determine an open file's size in Python?
1,867,399
2
12
11,581
0
python,linux,file,filesystems,ext2
Most reliable would be create a wrapping class which would check file's size when you open it, track write and seek operations, count current size based on those operations and prevent from exceeding size limit.
0
1
0
0
2009-12-08T14:33:00.000
7
0.057081
false
1,867,357
0
0
0
1
There's a file that I would like to make sure does not grow larger than 2 GB (as it must run on a system that uses ext 2). What's a good way to check a file's size bearing in mind that I will be writing to this file in between checks? In particular, do I need to worry about buffered, unflushed changes that haven't be...
Determine if Python is running inside virtualenv
57,109,196
5
397
237,037
0
python,virtualenv
Easiest way is to just run: which python, if you are in a virtualenv it will point to its python instead of the global one
0
1
0
0
2009-12-09T04:18:00.000
15
0.066568
false
1,871,549
1
0
0
3
Is it possible to determine if the current script is running inside a virtualenv environment?