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
is it possible to get python purple running either in cygwin or on a linux that isn't debian?
1,250,118
5
0
266
0
python,linux,cygwin,debhelper
Both cdbs and debhelper are only needed if you are trying to build a debian package. Just do a regular python setup.py build, and it should work fine (assuming you have the other prerequisites available).
0
1
0
0
2009-08-03T21:30:00.000
1
1.2
true
1,224,726
0
0
0
1
python purple says it needs dbms and debhelper in order to run, but I don't run debian. Is there a way to get this running on a different linux? or in cygwin?
In Twisted Python - Make sure a protocol instance would be completely deallocated
1,236,382
0
4
721
0
python,sockets,twisted,twisted.words
ok, for sorting out this issue I have set a __del__ method in the protocol class and I am now logging protocol instances that have not been garbage collected within 1 minute from the time the client has disconnected. If anybody has any better solution I'll still be glad to hear about it but so far I have already fixed...
0
1
1
0
2009-08-05T16:23:00.000
1
1.2
true
1,234,292
0
0
0
1
I have a pretty intensive chat socket server written in Twisted Python, I start it using internet.TCPServer with a factory and that factory references to a protocol object that handles all communications with the client. How should I make sure a protocol instance completely destroys itself once a client has disconnecte...
Cron job python Google App Engine
1,237,224
0
0
1,453
0
python,google-app-engine,cron,scheduled-tasks
"fetch" your OWN url (on appspot.com probably, but, who cares -- use a relative url anywau1-), not google.com, the homepage of the search engine -- what's that got to do w/your app anyway?!-)...
0
1
0
0
2009-08-06T05:32:00.000
1
0
false
1,237,126
0
0
1
1
I want to add a scheduled task to fetch a URL via cron job using google app engine. I am continuously getting a failure. I am just fetching www.google.com. Why is the url fetch failing? Am I missing something?
curses-like library for cross-platform console app in python
1,244,980
-7
24
13,292
0
python,windows,linux,console,ncurses
develop two interfaces for your program, a text console ui and a graphical ui. Make the console one work only on linux. Nobody on windows uses text console apps.
0
1
0
0
2009-08-07T14:06:00.000
5
-1
false
1,244,897
1
0
0
1
I'm looking into developing a console application in python which should be able to run under Windows as well as Linux. For this, I'd really like to use a high-level console library like curses. However, as far as I know, curses is not available on Windows. What other options do I have? Unfortunately, using cygwin unde...
Run Python script without opening Pythonwin
1,245,828
3
2
6,240
0
python
Rename it to *.pyw to hide the console on execution in Windows.
0
1
0
1
2009-08-07T16:48:00.000
4
0.148885
false
1,245,818
0
0
0
1
I have a python script which I can run from pythonwin on which I give the arguments. Is it possible to automate this so that when I just click on the *.py file, I don't see the script and it asks for the path in a dos window?
Python/mySQL on an Embedded ARM9 Device?
4,729,963
-1
0
1,766
0
python,arm,embedded
I suggest using SQLite. I have an application running Python+SQLite for telemetry purposes and it works like a charm. It's much easier than MySQL.
0
1
0
0
2009-08-07T18:12:00.000
2
-0.099668
false
1,246,235
0
0
0
1
I have an application where a small embedded ARM9 device (running Linux) must gather information from sensors and then connect to a remote mySQL database and INSERT the data. I have Python 2.5 running on the ARM9 device fine. I have developed a prototype application in Python 2.5 running on x86 Windows and it connects ...
Manipulate MP3 programmatically: Muting certain parts?
5,060,666
1
5
1,648
0
java,python,audio,mp3
One (somehow pretentious) idea: record a mute (silent) mp3 in bitrate that your mp3 is. Then, copy all the frames from original mp3 up to the point when you want your silence to start. Then, copy as much muted frames you need from your 'silence file'. Then, copy the rest from the original file. You'll have muted fi...
0
1
0
0
2009-08-08T22:57:00.000
4
0.049958
false
1,250,086
0
0
1
1
I'm trying to write a batch process that can take an MP3 file and mute certain parts of it, ideally in Python or Java. Take this example: Given a 2 minute MP3, I want to mute the time between 1:20 and 1:30. When saved back to a file, the rest of the MP3 will play normally -- only that portion will be silent. Any advice...
Creating alternative login to Google Users for Google app engine
1,251,369
1
4
928
0
python,google-app-engine,model-view-controller,google-cloud-datastore
If you roll your own user model, you're going to need to do your own session handling as well; the App Engine Users API creates login sessions for you behind the scenes. Also, while this should be obvious, you shouldn't store the user's password in plaintext; store an SHA-1 hash and compare it to a hash of the user's...
0
1
0
0
2009-08-09T02:46:00.000
2
0.099668
false
1,250,437
0
0
1
1
How does one handle logging in and out/creating users, without using Google Users? I'd like a few more options then just email and password. Is it just a case of making a user model with the fields I need? Is that secure enough? Alternatively, is there a way to get the user to log in using the Google ID, but without be...
Writing Windows GUI applications with embedded Python scripts
1,251,275
3
1
1,987
0
python,windows,user-interface
I would recommend that you use IronPython, which is Microsoft's implementation of Python for the .NET framework.
0
1
0
0
2009-08-09T12:04:00.000
3
0.197375
false
1,251,260
1
0
0
1
What would be the optimal way to develop a basic graphical application for Windows based on a Python console script? It would be great if the solution could be distributed as a standalone directory, containing the .exe file.
Has anyone succeeded in using Google App Engine with Python version 2.6?
1,255,893
6
9
3,409
0
python,google-app-engine
There are a few issues with using Python 2.6 with the SDK, mostly related to the SDK's sandboxing, which is designed to imitate the sandbox limitations in production. Note, of course, that even if you get Python 2.6 running with the SDK, your code will still have to run under 2.5 in production.
0
1
0
0
2009-08-10T09:58:00.000
2
1
false
1,254,028
0
0
1
1
Since Python 2.6 is backward compatible to 2.52 , did anyone succeeded in using it with Google app Engine ( which supports 2.52 officially ). I know i should try it myself. But i am a python and web-apps new bee and for me installation and configuration is the hardest part while getting started with something new in t...
Is it possible to add a network drive to %PATH% environment variable
1,272,313
4
1
5,469
0
python,windows,sysinternals
Yes you can put a UNC path in your %PATH% env variable, and it will work if you have access to that path with your current session.
0
1
0
0
2009-08-13T14:17:00.000
2
0.379949
false
1,272,242
0
0
0
1
I have a python script calling an exe file. The exe file can be in the same folder as that of the python script or in a network drive. Is it possible to call the exe if it is in a remote drive/computer? Can this be done by setting the %PATH% variable
How do you install lxml on OS X Leopard without using MacPorts or Fink?
1,277,175
-5
36
27,228
0
python,macos,shell,lxml,osx-leopard
I compile it in /usr/local without any issues whatsoever. Install Python, libxml2, libxslt and then lxml. You might need setuptools installed too.
0
1
0
0
2009-08-14T10:22:00.000
15
-1
false
1,277,124
0
0
0
2
I've tried this and run in to problems a bunch of times in the past. Does anyone have a recipe for installing lxml on OS X without MacPorts or Fink that definitely works? Preferably with complete 1-2-3 steps for downloading and building each of the dependencies.
How do you install lxml on OS X Leopard without using MacPorts or Fink?
7,850,559
1
36
27,228
0
python,macos,shell,lxml,osx-leopard
I had this working fine with Snow Lepoard but after I upgraded to Lion I had to symlink gcc-4.2 to gcc. Running sudo env ARCHFLAGS="-arch i386 -arch x86_64" easy_install lxml was looking for gcc-4.2 instead of gcc.
0
1
0
0
2009-08-14T10:22:00.000
15
0.013333
false
1,277,124
0
0
0
2
I've tried this and run in to problems a bunch of times in the past. Does anyone have a recipe for installing lxml on OS X without MacPorts or Fink that definitely works? Preferably with complete 1-2-3 steps for downloading and building each of the dependencies.
Python - capture Popen stdout AND display on console?
1,283,191
1
5
11,350
0
python,pipe,popen
Alternatively, you can pipe your process into tee and capture only one of the streams. Something along the lines of sh -c 'process interesting stuff' | tee /dev/stderr. Of course, this only works on Unix-like systems.
0
1
0
0
2009-08-15T22:48:00.000
5
0.039979
false
1,283,061
0
0
0
2
I want to capture stdout from a long-ish running process started via subprocess.Popen(...) so I'm using stdout=PIPE as an arg. However, because it's a long running process I also want to send the output to the console (as if I hadn't piped it) to give the user of the script an idea that it's still working. Is this at a...
Python - capture Popen stdout AND display on console?
1,283,062
1
5
11,350
0
python,pipe,popen
Can you simply print it as you read it from the pipe?
0
1
0
0
2009-08-15T22:48:00.000
5
1.2
true
1,283,061
0
0
0
2
I want to capture stdout from a long-ish running process started via subprocess.Popen(...) so I'm using stdout=PIPE as an arg. However, because it's a long running process I also want to send the output to the console (as if I hadn't piped it) to give the user of the script an idea that it's still working. Is this at a...
Entity Framwework-like ORM NOT for .NET
1,325,558
0
2
433
1
php,python,entity-framework,open-source
I have heard iBattis is good. A few companies fall back to iBattis when their programmer teams are not capable of understanding Hibernate (time issue). Personally, I still like Linq2Sql. Yes, the first time someone needs to delete and redrag over a table seems like too much work, but it really is not. And the time t...
0
1
0
0
2009-08-16T07:03:00.000
3
0
false
1,283,646
0
0
1
1
What I really like about Entity framework is its drag and drop way of making up the whole model layer of your application. You select the tables, it joins them and you're done. If you update the database scheda, right click -> update and you're done again. This seems to me miles ahead the competiting ORMs, like the mes...
How can I check to see if a Python script was started interactively?
1,285,056
11
2
1,179
0
python,interactive
You should simply add a command-line switch in the scheduled task, and check for it in your script, modifying the behavior as appropriate. Explicit is better than implicit. One benefit to this design: you'll be able to test both behaviors, regardless of how you actually invoked the script.
0
1
0
1
2009-08-16T18:48:00.000
3
1
false
1,285,024
0
0
0
1
I'd like for a script of mine to have 2 behaviours, one when started as a scheduled task, and another if started manually. How could I test for interactiveness? EDIT: this could either be a cron job, or started by a windows batch file, through the scheduled tasks.
Implement Comet / Server push in Google App Engine in Python
2,784,805
1
25
11,567
0
python,google-app-engine,comet,server-push,channel-api
30 seconds is more than enough; either way you should return a no-op message when a time passed and no new events occur. This prevents client timeouts and is done by everybody who does comet. Just send the request, and on the server make it wait until an event or timeout after 25 seconds.
0
1
0
0
2009-08-16T19:34:00.000
6
0.033321
false
1,285,150
0
0
1
4
How can I implement Comet / Server push in Google App Engine in Python?
Implement Comet / Server push in Google App Engine in Python
3,918,651
0
25
11,567
0
python,google-app-engine,comet,server-push,channel-api
Looking inside the App Engine 1.3.8-pre release, I see the Channel API service stub and more code. So it looks like we can start trying it out locally.
0
1
0
0
2009-08-16T19:34:00.000
6
0
false
1,285,150
0
0
1
4
How can I implement Comet / Server push in Google App Engine in Python?
Implement Comet / Server push in Google App Engine in Python
1,285,251
3
25
11,567
0
python,google-app-engine,comet,server-push,channel-api
At this time, I would rule out doing Comet in App Engine (any language). Comet is based on long-lived HTTP connections, and App Engine will time out any single connection in about 30 seconds or so at most; it's hard to conceive of a worse match!
0
1
0
0
2009-08-16T19:34:00.000
6
0.099668
false
1,285,150
0
0
1
4
How can I implement Comet / Server push in Google App Engine in Python?
Implement Comet / Server push in Google App Engine in Python
4,480,891
0
25
11,567
0
python,google-app-engine,comet,server-push,channel-api
Google App Engine supports server push using the Channel API since 2nd December.
0
1
0
0
2009-08-16T19:34:00.000
6
0
false
1,285,150
0
0
1
4
How can I implement Comet / Server push in Google App Engine in Python?
how to register more than 10 apps in Google App Engine
1,294,678
3
14
1,877
0
python,google-app-engine,registration
Call or write to Google! Google's policies are very exact and very strict, because they are catering to thousands of developers, and thus need those standards and uniformity. But if you have a good reason for needing more than 10, and you can get a real person at the end of a telephone line, I'd think you'd have a good...
0
1
0
0
2009-08-18T15:25:00.000
1
0.53705
false
1,294,618
0
0
1
1
Anyone knows any "legal" way to surpass the 10-app-limit Google imposes? I wouldn't mind to pay, or anything, but I wasn't able to find a way to have more than 10 apps and can't either remove one.
How to check if python is installed in windows from java?
1,299,061
0
3
13,675
0
java,python,installation
exec(String command) Executes the specified string command in a separate process. Check for Python from command
0
1
0
0
2009-08-19T10:32:00.000
5
0
false
1,299,018
1
0
0
3
How can I check from inside a java program if python is installed in windows? Python does not add its path to the system Path and no assumption is to be made about the probable path of installation(i.e it can be installed anywhere).
How to check if python is installed in windows from java?
1,299,062
2
3
13,675
0
java,python,installation
Use the Java Runtime to exec the following command "python --version". If it works, you have Python, and the standard output is the version number. If it doesn't work, you don't have Python.
0
1
0
0
2009-08-19T10:32:00.000
5
1.2
true
1,299,018
1
0
0
3
How can I check from inside a java program if python is installed in windows? Python does not add its path to the system Path and no assumption is to be made about the probable path of installation(i.e it can be installed anywhere).
How to check if python is installed in windows from java?
19,837,856
-2
3
13,675
0
java,python,installation
this would work Process process = Runtime.getRuntime().exec("cmd /c C:\Python27\python --version");
0
1
0
0
2009-08-19T10:32:00.000
5
-0.07983
false
1,299,018
1
0
0
3
How can I check from inside a java program if python is installed in windows? Python does not add its path to the system Path and no assumption is to be made about the probable path of installation(i.e it can be installed anywhere).
Why is Standard Input is not displayed as I type in Mac OS X Terminal application?
2,623,452
25
11
2,868
0
python,django,macos,shell,terminal
Maybe this is because there was an error while running Django. Sometimes it happens that the std input disappears because stty was used. You can manually hide your input by typing: $ stty -echo Now you won't see what you typed. To restore this and solve your problem just type $ stty echo This could help.
0
1
0
0
2009-08-19T18:44:00.000
3
1
false
1,301,887
0
0
1
2
I'm confused by some behavior of my Mac OS X Terminal and my Django manage.py shell and pdb. When I start a new terminal, the Standard Input is displayed as I type. However, if there is an error, suddenly Standard Input does not appear on the screen. This error continues until I shut down that terminal window. The Inpu...
Why is Standard Input is not displayed as I type in Mac OS X Terminal application?
2,018,573
3
11
2,868
0
python,django,macos,shell,terminal
If you exit pdb you can type reset and standard input echo will return. I'm not sure if you can execute something similar within pdb. It will erase what is currently displayed however.
0
1
0
0
2009-08-19T18:44:00.000
3
0.197375
false
1,301,887
0
0
1
2
I'm confused by some behavior of my Mac OS X Terminal and my Django manage.py shell and pdb. When I start a new terminal, the Standard Input is displayed as I type. However, if there is an error, suddenly Standard Input does not appear on the screen. This error continues until I shut down that terminal window. The Inpu...
Do any Python ORMs (SQLAlchemy?) work with Google App Engine?
11,325,656
2
11
5,333
1
python,google-app-engine,sqlalchemy,orm
Nowadays they do since Google has launched Cloud SQL
0
1
0
0
2009-08-20T19:39:00.000
2
0.197375
false
1,308,376
0
0
1
1
I'd like to use the Python version of App Engine but rather than write my code specifically for the Google Data Store, I'd like to create my models with a generic Python ORM that could be attached to Big Table, or, if I prefer, a regular database at some later time. Is there any Python ORM such as SQLAlchemy that would...
Where is the best place to put cache-evicting logic in an AppEngine application?
1,348,633
1
2
306
0
python,google-app-engine,optimization,caching,memcached
A couple of alternatives to regular eviction: The obvious one: Don't evict, and set a timer instead. Even a really short one - a few seconds - can cut down on effort a huge amount for a popular app, without users even noticing data may be a few seconds stale. Instead of evicting, generate the cache key based on criter...
0
1
0
0
2009-08-21T18:44:00.000
2
0.099668
false
1,313,626
0
0
1
1
I've written an application for Google AppEngine, and I'd like to make use of the memcache API to cut down on per-request CPU time. I've profiled the application and found that a large chunk of the CPU time is in template rendering and API calls to the datastore, and after chatting with a co-worker I jumped (perhaps a ...
easiest way to program a virtual file system in windows with Python
1,325,685
3
10
4,784
0
python,windows,filesystems
Does it need to be Windows-native? There is at least one protocol which can be both browsed by Windows Explorer, and served by free Python libraries: FTP. Stick your program behind pyftpdlib and you're done.
0
1
0
0
2009-08-25T01:10:00.000
5
0.119427
false
1,325,568
1
0
0
2
I want to program a virtual file system in Windows with Python. That is, a program in Python whose interface is actually an "explorer windows". You can create & manipulate file-like objects but instead of being created in the hard disk as regular files they are managed by my program and, say, stored remotely, or encry...
easiest way to program a virtual file system in windows with Python
1,325,652
2
10
4,784
0
python,windows,filesystems
If you are trying to write a virtual file system (I may misunderstand you) - I would look at a container file format. VHD is well documented along with HDI and (embedded) OSQ. There are basically two things you need to do. One is you need to decide on a file/container format. After that it is as simple as writing the A...
0
1
0
0
2009-08-25T01:10:00.000
5
0.07983
false
1,325,568
1
0
0
2
I want to program a virtual file system in Windows with Python. That is, a program in Python whose interface is actually an "explorer windows". You can create & manipulate file-like objects but instead of being created in the hard disk as regular files they are managed by my program and, say, stored remotely, or encry...
How to remotely restart a service on a password protected machine using Python?
1,332,904
1
0
4,489
0
python,remote-access
Which OS for the target machines? If 'service' is 'Windows NT service', and your local machine is also Windows, I'd use IronPython as the Python language implementation and call straight into the WMI facilities in the .net System.Management namespace -- they're meant for remote admin like that.
0
1
0
0
2009-08-26T07:10:00.000
5
0.039979
false
1,332,853
0
0
0
1
I decided to tackle Python as a new language to learn. The first thing I want to do is code a script that will allow me to remotely restart services on other machines from my local machine. How would I accomplish this when the remote machine requires a username and password to log on? I don't need a full solution to be...
Locally Hosted Google App Engine (WebApp Framework / BigTable)
1,342,175
4
1
911
0
python,google-app-engine,mod-wsgi
Webapp is a fine choice for a simple web framework but there are plenty of other simple python web frameworks that have instructions for setting them up in your use case (cherrypy, web.py, etc). Since google developed webapp for gae I don't believe they published instructions for setting it up behind apache. BigTable i...
0
1
0
0
2009-08-27T12:51:00.000
1
1.2
true
1,340,887
0
0
1
1
I have been playing with Google App engine a lot lately, from home on personal projects, and I have been really enjoying it. I've converted a few of my coworkers over and we are interested in using GAE for a few of our projects at work. Our work has to be hosted locally on our own servers. I've done some searching arou...
Python version shipping with Mac OS X Snow Leopard?
1,350,316
12
10
10,496
0
python,macos,osx-snow-leopard
It ships with both python 2.6.1 and 2.5.4. $ python2.5 Python 2.5.4 (r254:67916, Jul 7 2009, 23:51:24) $ python Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51)
0
1
0
0
2009-08-28T14:30:00.000
5
1
false
1,347,376
1
0
0
3
I would appreciate it if somebody running the final version of Snow Leopard could post what version of Python is included with the OS (on a Terminal, just type "python --version") Thanks!
Python version shipping with Mac OS X Snow Leopard?
1,352,207
1
10
10,496
0
python,macos,osx-snow-leopard
You can get an installer for 2.6.2 from python.org, no reason to go without.
0
1
0
0
2009-08-28T14:30:00.000
5
0.039979
false
1,347,376
1
0
0
3
I would appreciate it if somebody running the final version of Snow Leopard could post what version of Python is included with the OS (on a Terminal, just type "python --version") Thanks!
Python version shipping with Mac OS X Snow Leopard?
1,347,397
3
10
10,496
0
python,macos,osx-snow-leopard
Python 2.6.1 (according to the web) Really good to know :)
0
1
0
0
2009-08-28T14:30:00.000
5
0.119427
false
1,347,376
1
0
0
3
I would appreciate it if somebody running the final version of Snow Leopard could post what version of Python is included with the OS (on a Terminal, just type "python --version") Thanks!
How do I create a file in python without overwriting an existing file
1,348,441
0
25
12,132
0
python,multithreading,file
If you have an id associated with each thread / process that tries to create the file, you could put that id in the suffix somewhere, thereby guaranteeing that no two processes can use the same file name. This eliminates the race condition between the processes.
0
1
0
0
2009-08-28T16:14:00.000
3
0
false
1,348,026
1
0
0
1
Currently I have a loop that tries to find an unused filename by adding suffixes to a filename string. Once it fails to find a file, it uses the name that failed to open a new file wit that name. Problem is this code is used in a website and there could be multiple attempts to do the same thing at the same time, so a...
Python 3.1.1 on Mac OS X 10.6 Snow Leopard
1,649,335
0
2
8,496
0
macos,osx-snow-leopard,python-3.x
Kenneth Reitz's soluton doesn't work for me. In fact, the install works fine but my default PATH still points to /usr/bin/python (v2.6.1.). I vaguely recall that we should be modifying our ~/.profile to point to /.../Frameworks and I expected the installer to do this for me (nope). Anyway, /Library/Frameworks/Python.fr...
0
1
0
0
2009-08-29T19:56:00.000
4
0
false
1,352,230
0
0
0
1
I've spent some time today playing with getting the source for python 3.1.1 to build on my MacBook Pro using the --enable-framework and --enable-universalsdk options with no success. I will humbly admit that I have no real clue why I can't compile 3.1.1 on Snow Leopard, I did make sure to get the new Xcode version for ...
Python script performance as a background process
1,352,777
5
0
738
0
python,performance,process,background
If you are using blocking I/O to your devices, then the script won't consume any processor while waiting for the data. How much processor you use depends on what sorts of computation you are doing with the data.
0
1
1
0
2009-08-30T00:58:00.000
2
0.462117
false
1,352,760
1
0
0
1
Im in the process of writing a python script to act as a "glue" between an application and some external devices. The script itself is quite straight forward and has three distinct processes: Request data (from a socket connection, via UDP) Receive response (from a socket connection, via UDP) Process response and make...
Why is '#!/usr/bin/env python' supposedly more correct than just '#!/usr/bin/python'?
1,352,927
5
71
38,302
0
python,bash
It finds 'python' also in /usr/local/bin, ~/bin, /opt/bin, ... or wherever it may hide.
0
1
0
1
2009-08-30T02:30:00.000
5
0.197375
false
1,352,922
1
0
0
3
Anyone know this? I've never been able to find an answer.
Why is '#!/usr/bin/env python' supposedly more correct than just '#!/usr/bin/python'?
1,352,941
10
71
38,302
0
python,bash
it finds the python executable in your environment and uses that. it's more portable because python may not always be in /usr/bin/python. env is always located in /usr/bin.
0
1
0
1
2009-08-30T02:30:00.000
5
1
false
1,352,922
1
0
0
3
Anyone know this? I've never been able to find an answer.
Why is '#!/usr/bin/env python' supposedly more correct than just '#!/usr/bin/python'?
1,352,938
67
71
38,302
0
python,bash
If you're prone to installing python in various and interesting places on your PATH (as in $PATH in typical Unix shells, %PATH on typical Windows ones), using /usr/bin/env will accomodate your whim (well, in Unix-like environments at least) while going directly to /usr/bin/python won't. But losing control of what vers...
0
1
0
1
2009-08-30T02:30:00.000
5
1.2
true
1,352,922
1
0
0
3
Anyone know this? I've never been able to find an answer.
file system performance testing
1,356,966
0
1
1,679
0
python,filesystems,performance-testing
You might be inetersting in looking at tools like caollectd and iotop. Then again, yopu mightalso by interested in just using them instead of reinventing the wheel - as far as I see, such performance analysis is not learned in a day, and these guys invested significant amounts of time and knowledge in building these t...
0
1
0
1
2009-08-31T07:29:00.000
4
0
false
1,356,240
0
0
0
1
I am writing a python script that will perform performance test in linux file system. so besides deadlocks, race conditions and time takes to perform an action (delete, read, write and create) what other variables/parameters should the test contain?
Block requests from *.appspot.com and force custom domain in Google App Engine
1,364,875
17
14
5,133
0
python,google-app-engine,redirect
You can check if os.environ['HTTP_HOST'].endswith('.appspot.com') -- if so, then you're serving from something.appspot.com and can send a redirect, or otherwise alter your behavior as desired. You could deploy this check-and-redirect-if-needed (or other behavior alteration of your choice) in any of various ways (decora...
0
1
0
0
2009-09-01T21:26:00.000
5
1.2
true
1,364,733
0
0
1
1
How can I prevent a user from accessing my app at example.appspot.com and force them to access it at example.com? I already have example.com working, but I don't want users to be able to access the appspot domain. I'm using python.
How to deal with user authentication and wrongful modification in scripting languages?
1,365,394
1
2
272
0
python,security,design-patterns,authentication,cracking
Possibly: The user enters their credentials into the desktop client. The client says to the server: "Hi, my name username and my password is password". The server checks these. The server says to the client: "Hi, username. Here is your secret token: ..." Subsequently the client uses the secret token together with the...
0
1
0
1
2009-09-02T00:03:00.000
2
0.099668
false
1,365,254
0
0
0
2
I'm building a centralized desktop application using Python/wxPython. One of the requirements is User authentication, which I'm trying to implement using LDAP (although this is not mandatory). Users of the system will be mechanical and electrical engineers making budgets, and the biggest problem would be industrial esp...
How to deal with user authentication and wrongful modification in scripting languages?
1,365,422
3
2
272
0
python,security,design-patterns,authentication,cracking
How malicious are your users? Really. Exactly how malicious? If your users are evil sociopaths and can't be trusted with a desktop solution, then don't build a desktop solution. Build a web site. If your users are ordinary users, they'll screw the environment up by installing viruses, malware and keyloggers from porn...
0
1
0
1
2009-09-02T00:03:00.000
2
1.2
true
1,365,254
0
0
0
2
I'm building a centralized desktop application using Python/wxPython. One of the requirements is User authentication, which I'm trying to implement using LDAP (although this is not mandatory). Users of the system will be mechanical and electrical engineers making budgets, and the biggest problem would be industrial esp...
On localhost, how do I pick a free port number?
1,365,281
47
189
154,753
0
python,sockets,ipc,port
Bind the socket to port 0. A random free port from 1024 to 65535 will be selected. You may retrieve the selected port with getsockname() right after bind().
0
1
1
0
2009-09-02T00:07:00.000
5
1
false
1,365,265
0
0
0
2
I'm trying to play with inter-process communication and since I could not figure out how to use named pipes under Windows I thought I'll use network sockets. Everything happens locally. The server is able to launch slaves in a separate process and listens on some port. The slaves do their work and submit the result to ...
On localhost, how do I pick a free port number?
1,365,283
4
189
154,753
0
python,sockets,ipc,port
You can listen on whatever port you want; generally, user applications should listen to ports 1024 and above (through 65535). The main thing if you have a variable number of listeners is to allocate a range to your app - say 20000-21000, and CATCH EXCEPTIONS. That is how you will know if a port is unusable (used by a...
0
1
1
0
2009-09-02T00:07:00.000
5
0.158649
false
1,365,265
0
0
0
2
I'm trying to play with inter-process communication and since I could not figure out how to use named pipes under Windows I thought I'll use network sockets. Everything happens locally. The server is able to launch slaves in a separate process and listens on some port. The slaves do their work and submit the result to ...
Managing multiple Twisted client connections
1,408,498
4
6
4,725
0
python,twisted
The best option is really just to do the obvious thing here. Don't have a loop, or a repeating timed call; just have handlers that do the right thing. Keep a central connection-management object around, and make event-handling methods feed it the information it needs to keep going. When it starts, make 5 outgoing con...
0
1
1
0
2009-09-02T03:45:00.000
3
1.2
true
1,365,737
0
0
0
1
I'm trying to use Twisted in a sort of spidering program that manages multiple client connections. I'd like to maintain of a pool of about 5 clients working at one time. The functionality of each client is to connect to a specified IRC server that it gets from a list, enter a specific channel, and then save the list ...
Python long filename support broken in Windows
1,365,827
9
13
8,165
0
python,windows,python-2.x
In order to use the \\?\ prefix (as already proposed), you also need to make sure you use Unicode strings as filenames, not regular (byte) strings.
0
1
0
0
2009-09-02T04:15:00.000
6
1
false
1,365,797
0
0
0
1
I write Python script to copy files; unfortunately it keeps failing because filename is too long(>256). Is there anyway to deal with that problem? I'm using Python 2.5.4 and Windows XP. Cheers,
How would you query Picasa from a Google App Engine app? Data API or Url Fetch?
1,369,908
2
0
1,248
0
python,api,google-app-engine,picasa,urlfetch
Your question is a little off, since the Data API is exposed through RESTful URLs, so both methods are ultimately a "URL Fetch". The Data API works quite well, though. It gives you access to nearly all the functionality of Picasa, and responses are sent back and forth in well-formed, well-documented XML. Google's docum...
0
1
0
0
2009-09-02T20:10:00.000
1
1.2
true
1,369,861
0
0
1
1
How would you query Picasa from a Google App Engine app? Data API or Url Fetch? What are the pros and cons of using either method? [Edit] I would like to be able to query a specific album in Picasa and list all the photos in it. Code examples to do this in python are much appreciated.
How to get list opened windows in PyGTK or GTK in Ubuntu?
1,380,909
2
10
9,460
0
python,ubuntu,gtk,pygtk,window-management
I really don't know how to check if a window is a GTK one. But if you want to check how many windows are currently open try "wmctrl -l". Install it first of course.
0
1
0
0
2009-09-04T18:18:00.000
6
0.066568
false
1,380,784
0
0
0
1
How to get list opened windows in PyGTK or GTK or other programming language? in Ubuntu? edit: i want get list paths opened directories on desktop!
Is packaging scripts as executables a solution for comercial applications?
1,381,231
2
0
260
0
python,ruby,executable
py2exe is great, I've used it before and it works just fine for encapsulating a program so it can run on other computers, even those lacking python. Like Alex said, it can be disassembled, but then so can C++ binaries. It's just a question of how much work the person is has to put into it. If someone has physical acces...
0
1
0
0
2009-09-04T18:34:00.000
4
0.099668
false
1,380,852
1
0
0
2
What happens when you package a script as an executable? Is this a good way to distribute commercial applications? I remember I read something a long time ago that when you package scripts as executables, at runtime the exe decompresses the scripts to a temporary directory where they get ran. If it's like that, than I ...
Is packaging scripts as executables a solution for comercial applications?
1,381,289
3
0
260
0
python,ruby,executable
Creating an application and creating a commercial software business are two distinct things. At my job we have a commercial application developed in Ruby on Rails that is installed at client sites; no obfuscation or encryption applied. There is just so much more going on at a business level: support, customization, t...
0
1
0
0
2009-09-04T18:34:00.000
4
0.148885
false
1,380,852
1
0
0
2
What happens when you package a script as an executable? Is this a good way to distribute commercial applications? I remember I read something a long time ago that when you package scripts as executables, at runtime the exe decompresses the scripts to a temporary directory where they get ran. If it's like that, than I ...
Converting latex code to Images (or other displayble format) with Python
1,381,791
0
26
19,039
0
python,latex
You're going to need to use LaTeX to process to string. The process of rendering LaTex/TeX is very involved (it generally takes a 100+MB package to do the work), you're just not going to be able toss in a little python module to get the work done.
0
1
0
0
2009-09-04T22:04:00.000
7
0
false
1,381,741
1
0
0
1
I have a function I am consuming that returns a string of latex code. I need to generate an image from this. Most of the methods I have seen for doing so suggest calling an external application via say the subprocess module which will generate the image for me. However, management is not keen on this as it will req...
OS X - multiple python versions, PATH and /usr/local
1,384,223
0
5
4,778
0
python,macos,path,multiple-versions
I just noticed/encountered this issue on my Mac. I have Python 2.5.4, 2.6.2, and 3.1.1 on my machine, and was looking for a way to easily change between them at will. That is when I noticed all the symlinks for the executables, which I found in both '/usr/bin' and '/usr/local/bin'. I ripped all the non-version specific...
0
1
0
0
2009-09-05T17:40:00.000
2
0
false
1,383,863
1
0
0
2
If you install multiple versions of python (I currently have the default 2.5, installed 3.0.1 and now installed 2.6.2), it automatically puts stuff in /usr/local, and it also adjusts the path to include the /Library/Frameworks/Python/Versions/theVersion/bin, but whats the point of that when /usr/local is already on the...
OS X - multiple python versions, PATH and /usr/local
1,383,891
5
5
4,778
0
python,macos,path,multiple-versions
There's no a priori guarantee that /usr/local/bin will stay on the PATH (especially it will not necessarily stay "in front of" /usr/bin!-), so it's perfectly reasonable for an installer to ensure the specifically needed /Library/.../bin directory does get on the PATH. Plus, it may be the case that the /Library/.../bin...
0
1
0
0
2009-09-05T17:40:00.000
2
1.2
true
1,383,863
1
0
0
2
If you install multiple versions of python (I currently have the default 2.5, installed 3.0.1 and now installed 2.6.2), it automatically puts stuff in /usr/local, and it also adjusts the path to include the /Library/Frameworks/Python/Versions/theVersion/bin, but whats the point of that when /usr/local is already on the...
Reliably detect Windows in Python
1,387,226
16
64
34,871
0
python,windows,platform-detection
On my Windows box, platform.system() returns 'Windows'. However, I'm not sure why you'd bother. If you want to limit the platform it runs on technologically, I'd use a white-list rather than a black-list. In fact, I wouldn't do it technologically at all since perhaps the next release of Python may have Win32/Win64 inst...
0
1
0
0
2009-09-07T01:29:00.000
6
1
false
1,387,222
1
0
0
1
I'm working on a couple of Linux tools and need to prevent installation on Windows, since it depends on FHS and is thus rendered useless on that platform. The platform.platform function comes close but only returns a string. Unfortunately I don't know what to search for in that string for it to yield a reliable result....
Upgrade python in linux
1,388,552
6
2
25,211
0
python,linux
The safest way to upgrading Python is to install it to a different location (away from the default system path). To do this, download the source of python and do a ./configure --prefix=/opt (Assuming you want to install it to /opt which is where most install non system dependant stuff to) The reason why I say this is ...
0
1
0
0
2009-09-07T09:36:00.000
3
1
false
1,388,464
1
0
0
2
I have a linux VPS that uses an older version of python (2.4.3). This version doesn't include the UUID module, but I need it for a project. My options are to upgrade to python2.6 or find a way to make uuid work with the older version. I am a complete linux newbie. I don't know how to upgrade python safely or how I coul...
Upgrade python in linux
1,391,295
0
2
25,211
0
python,linux
The best solution will be installing python2.6 in the choosen directory - It will you give you access to many great features and better memory handling (infamous python=2.4 memory leak problem). I have got several pythons installed onto my two computers, I found that the best solution for are two directories: $HOME/usr...
0
1
0
0
2009-09-07T09:36:00.000
3
0
false
1,388,464
1
0
0
2
I have a linux VPS that uses an older version of python (2.4.3). This version doesn't include the UUID module, but I need it for a project. My options are to upgrade to python2.6 or find a way to make uuid work with the older version. I am a complete linux newbie. I don't know how to upgrade python safely or how I coul...
How to process UDP data in Appengine
17,618,253
0
1
2,113
0
python,google-app-engine,udp
You could run a separate agent on a cloud host like DigitalOcean or Amazon EC2 that proxies this protocol and makes itself available to Google App Engine via ordinary HTTP or web sockets.
0
1
0
0
2009-09-07T13:14:00.000
3
0
false
1,389,385
0
0
1
1
I have a service provider who is transmitting data thro' UDP. I want to establish a connection to them, receive & process data (will be with in the 30 sec limit/request) Is it possible to get & process UDP data in appengine. I am looking for some simple example.
Is it possible to deploy one GAE application from another GAE application?
1,392,766
5
3
418
0
python,google-app-engine
Is it possible? Yes. The protocol appcfg uses to update apps is entirely HTTP-based, so there's absolutely no reason you couldn't write an app that's capable of deploying other apps (or redeploying itself - self-modifying code)! You may even be able to reuse large parts of appcfg.py to do it. Is it easy? Probably not. ...
0
1
0
0
2009-09-08T02:02:00.000
3
1.2
true
1,391,608
0
0
1
3
In order to redeploy a GAE application, I currently have to install the GAE deployment tools on the system that I am using for deployment. While this process is relatively straight forward, the deployment process is a manual process that does not work from behind a firewall and the deployment tools must be installed on...
Is it possible to deploy one GAE application from another GAE application?
1,391,649
2
3
418
0
python,google-app-engine
One limiting constraint could be the protocol that the python sdk uses to communicate with the GAE servers. If it only uses HTTP, you might be OK. but if it's anything else, you might be out of luck because you can't open a socket directly from within GAE.
0
1
0
0
2009-09-08T02:02:00.000
3
0.132549
false
1,391,608
0
0
1
3
In order to redeploy a GAE application, I currently have to install the GAE deployment tools on the system that I am using for deployment. While this process is relatively straight forward, the deployment process is a manual process that does not work from behind a firewall and the deployment tools must be installed on...
Is it possible to deploy one GAE application from another GAE application?
1,391,652
0
3
418
0
python,google-app-engine
What problem did you have by trying to update behind a firewall? I've got some, but finally I manage to work around them. About your question, the constraint is that you cannot write files into a GAE app, so even though you could possibly pull from the VCS you can't write those pulled files. So you would have to upda...
0
1
0
0
2009-09-08T02:02:00.000
3
0
false
1,391,608
0
0
1
3
In order to redeploy a GAE application, I currently have to install the GAE deployment tools on the system that I am using for deployment. While this process is relatively straight forward, the deployment process is a manual process that does not work from behind a firewall and the deployment tools must be installed on...
How do I keep state between requests in AppEngine (Python)?
1,406,768
3
1
564
0
python,google-app-engine
The ways to reliable keep state between requests are memcache, the datastore or through the user (cookies or post/get). You can use the runtime cache too, but this is very unreliable as you don't know if a request will end up in the same runtime or the runtime can drop it's entire cache if it feels like it. I really wo...
0
1
0
0
2009-09-10T17:32:00.000
2
0.291313
false
1,406,636
0
0
1
1
I'm writing a simple app with AppEngine, using Python. After a successful insert by a user and redirect, I'd like to display a flash confirmation message on the next page. What's the best way to keep state between one request and the next? Or is this not possible because AppEngine is distributed? I guess, the underlyi...
Does python logging.handlers.RotatingFileHandler allow creation of a group writable log file?
67,012,969
0
38
14,631
0
python,logging,python-logging
I think what described here is an anti-pattern - different processes should not write data into the same file. And non of the solutions above worked for me, causing different permissions issues in different scenarios. As a temp workaround I've added a random suffix into the log filename so each process will get a uniqu...
0
1
0
0
2009-09-10T20:14:00.000
8
0
false
1,407,474
0
0
0
1
I'm using the standard python (2.5.2) logging module, specifically the RotatingFileHandler, on a linux system. My application supports both a command-line interface and a web-service interface. I would like to have both write to the same log file. However, when the log file gets rotated, the new file has 644 permiss...
Get file creation time with Python on linux
48,969,869
-1
21
11,846
0
python,linux
What do you mean it can't be done [1]? The function, os.stat(path).st_birthtime, works great. [1]: Somebody said that it couldn’t be done But he with a chuckle replied That “maybe it couldn’t,” but he would be one Who wouldn’t say so till he’d tried. So he buckled right in with the trace of a grin On...
0
1
0
1
2009-09-10T23:35:00.000
7
-0.028564
false
1,408,272
0
0
0
1
os.stat returns st_mtime and st_ctime attributes, the modification time is st_mtime and st_ctime "change time" on POSIX. is there any function that return the creation time of a file using python and under Linux?
send an arbitrary number of inputs from python to a .exe
1,408,428
1
2
656
0
python,executable
Avoid concatenating all arguments into one string using that string. It's a lot simpler and better and safer to just pass a sequence (list or tuple) of arguments. This is specially true if any argument contains a space character (which is quite common for filenames).
0
1
0
0
2009-09-10T23:48:00.000
4
0.049958
false
1,408,326
1
0
0
1
p = subprocess.Popen(args = "myprog.exe" + " " + str(input1) + " " + str(input2) + " " + str(input3) + " " + strpoints, stdout = subprocess.PIPE) in the code above, input1, input2, and input3 are all integers that get converted to stri...
Track process status with Python
1,408,646
1
3
4,015
0
python,process,crash,subprocess
Yes to all.
0
1
0
0
2009-09-11T01:47:00.000
2
0.099668
false
1,408,627
0
0
0
1
I want to start a number of subprocesses in my Python script and then track when they complete or crash. subprocess.Popen.poll() seems to return None when the process is still running, 0 on success, and non-zero on failure. Can that be expected on all OS's? Unfortunately the standard library documentation is lacking fo...
Apache vs Twisted
1,411,038
11
6
4,183
0
python,apache,twisted
Twisted is a platform for developing internet applications, for handling the underlying communications and such. It doesn't "do" anything out of the box--you've got to program it. Apache is an internet application, of sorts. Upon install, you have a working web server which can serve up static and dynamic web pages. Be...
0
1
0
0
2009-09-11T13:46:00.000
4
1.2
true
1,410,967
0
0
0
3
I know Twisted is a framework that allows you to do asynchronous non-blocking i/o but I still do not understand how that is different from what Apache server does. If anyone could explain the need for twisted, I would appreciate it..
Apache vs Twisted
1,456,513
2
6
4,183
0
python,apache,twisted
@alphazero You read that Twisted vs. Tornado benchmark wrong (or you didn't read it at all). Quote from the article: " Lower mean response time is better." Twisted is lower. People want their webservers to respond with lower (faster) times. Twisted leaves Tornado in the dust... or, in reality, they differ by a nearly...
0
1
0
0
2009-09-11T13:46:00.000
4
0.099668
false
1,410,967
0
0
0
3
I know Twisted is a framework that allows you to do asynchronous non-blocking i/o but I still do not understand how that is different from what Apache server does. If anyone could explain the need for twisted, I would appreciate it..
Apache vs Twisted
1,411,014
2
6
4,183
0
python,apache,twisted
They are two different things, one is a pure WEB server and one is a WEB framework with a builtin event driven servers. Twisted is good for constructing high-end ad-hoc network services.
0
1
0
0
2009-09-11T13:46:00.000
4
0.099668
false
1,410,967
0
0
0
3
I know Twisted is a framework that allows you to do asynchronous non-blocking i/o but I still do not understand how that is different from what Apache server does. If anyone could explain the need for twisted, I would appreciate it..
Twisted(asynch server) vs Django(or any other framework)
1,468,718
5
15
11,799
0
python,django,asynchronous,twisted,real-time
The biggest advantage for me is that Twisted gives me an application that has state, and can communicate with many different clients using many protocols. For me, my Twisted server communicates with a number of sensors installed in houses and businesses that monitor power usage. It stores the data and keeps recent data...
0
1
0
0
2009-09-11T17:09:00.000
6
0.16514
false
1,412,169
0
0
1
4
I need help understanding what the advantage of using an asynch framework is. Suppose I want to develop a simple chat web app. Why cant I write python code in the Django framework that does long polling where I dont send a response back the server until someone enters a new msg. What does Twisted provide that gives it ...
Twisted(asynch server) vs Django(or any other framework)
1,417,358
3
15
11,799
0
python,django,asynchronous,twisted,real-time
In twisted you can implement protocols of your own. Django certainly can't do this.
0
1
0
0
2009-09-11T17:09:00.000
6
0.099668
false
1,412,169
0
0
1
4
I need help understanding what the advantage of using an asynch framework is. Suppose I want to develop a simple chat web app. Why cant I write python code in the Django framework that does long polling where I dont send a response back the server until someone enters a new msg. What does Twisted provide that gives it ...
Twisted(asynch server) vs Django(or any other framework)
1,412,226
16
15
11,799
0
python,django,asynchronous,twisted,real-time
Asynchronous servers support much larger numbers of simultaneous client connections. More conventional servers come up against thread and process limits when servicing large number of concurrent clients, particularly those with long-lived connections. Async servers can also provide better performance as they avoid the ...
0
1
0
0
2009-09-11T17:09:00.000
6
1.2
true
1,412,169
0
0
1
4
I need help understanding what the advantage of using an asynch framework is. Suppose I want to develop a simple chat web app. Why cant I write python code in the Django framework that does long polling where I dont send a response back the server until someone enters a new msg. What does Twisted provide that gives it ...
Twisted(asynch server) vs Django(or any other framework)
1,412,372
19
15
11,799
0
python,django,asynchronous,twisted,real-time
First off Django is a framework for writing web apps so it provides ORM, html templating, it requires running an http server etc. Twisted helps to write much lower level code than that. You could use twisted to write the http server Django runs on. If you use Django you are limited to http model, with twisted it cou...
0
1
0
0
2009-09-11T17:09:00.000
6
1
false
1,412,169
0
0
1
4
I need help understanding what the advantage of using an asynch framework is. Suppose I want to develop a simple chat web app. Why cant I write python code in the Django framework that does long polling where I dont send a response back the server until someone enters a new msg. What does Twisted provide that gives it ...
Resources for developing Python and Google App Engine
1,415,236
3
2
471
0
python,google-app-engine,user-controls,controls
The google app engine "Getting Started" tutorial is very good. The django documentation is also really detailed. Take a look at GoogleIO on youtube and watch some of the tutorials.
0
1
0
0
2009-09-12T14:07:00.000
3
0.197375
false
1,415,208
0
0
1
2
I would like to ask about some sources for developing applications with Python and Google App Engine. For example, some controls to generate automatically pages with the insert/update/delete of a database table, or any other useful resources are welcome. Thank you!
Resources for developing Python and Google App Engine
1,419,518
7
2
471
0
python,google-app-engine,user-controls,controls
The Python community tends to look askance at code generation; so, @Hoang, if you think code generation is THE way to go, I suggest you try just about any other language BUT Python. @Dominic has already suggested some excellent resources, I could point you to more (App Engine Fan, App Engine Utilities, etc, etc) but th...
0
1
0
0
2009-09-12T14:07:00.000
3
1.2
true
1,415,208
0
0
1
2
I would like to ask about some sources for developing applications with Python and Google App Engine. For example, some controls to generate automatically pages with the insert/update/delete of a database table, or any other useful resources are welcome. Thank you!
Google appengine string replacement in template file
1,416,947
1
0
600
0
python,google-app-engine
Apart from the argument-less .fetch() call in your code, which I believe can't possibly work (you ALWAYS have to pass fetch an argument -- the max number of entities you're willing to fetch!), I can't reproduce your problem -- assigning a new attribute (including one obtained by processing existing ones) to each item j...
0
1
0
0
2009-09-13T05:23:00.000
2
0.099668
false
1,416,921
0
0
1
1
I'm using google appengine (python, of course :) ) and I'd like to do a string.replace on a string from the template file. {% for item in items %} <p>{{ item.code.replace( '_', ' ' ) }}</p> {% endfor %} But that isn't working. So we cannot execute anything other than basic checks in the app engine templates. Is t...
Auto executable python file without opening from terminal?
1,419,455
3
3
9,279
0
python,linux
First, pick a file extension you want for files you want to have this behavior. pyw is probably a good choice. Name your file that, and in your file browser associate that file type with python. In GNOME, you'd open its Properties window, go to the Open With tab, and enter python as a custom command. Now here's the i...
0
1
0
1
2009-09-13T18:53:00.000
6
1.2
true
1,418,553
0
0
0
1
Sorry if this is on the wrong site ( maybe superuser ) but I'm trying to make my python.py file executable so I can click on it and it automatically does its thing, without me specifying it to open in the terminal by that default prompt, and I already have 'chmod +x' for its permissions. Clarification: I want to run i...
fcntl substitute on Windows
1,422,436
95
86
122,994
0
python,windows,linux
The substitute of fcntl on windows are win32api calls. The usage is completely different. It is not some switch you can just flip. In other words, porting a fcntl-heavy-user module to windows is not trivial. It requires you to analyze what exactly each fcntl call does and then find the equivalent win32api code, if any....
0
1
0
1
2009-09-14T15:43:00.000
3
1.2
true
1,422,368
0
0
0
1
I received a Python project (which happens to be a Django project, if that matters,) that uses the fcntl module from the standard library, which seems to be available only on Linux. When I try to run it on my Windows machine, it stops with an ImportError, because this module does not exist here. Is there any way for me...
Default save path for Python IDLE?
20,500,218
4
9
28,611
0
python,python-idle
I actually just discovered the easiest answer, if you use the shortcut link labeled "IDLE (Python GUI)". This is in Windows Vista, so I don't know if it'll work in other OS's. 1) Right-click "Properties". 2) Select "Shortcut" tab. 3) In "Start In", write file path (e.g. "C:\Users..."). Let me know if this works!
0
1
0
1
2009-09-14T23:28:00.000
11
0.072599
false
1,424,398
0
0
0
8
Does anyone know where or how to set the default path/directory on saving python scripts prior to running? On a Mac it wants to save them in the top level ~/Documents directory. I would like to specify a real location. Any ideas?
Default save path for Python IDLE?
35,376,000
1
9
28,611
0
python,python-idle
For OS X: Open a new finder window,then head over to applications. Locate your Python application. (For my mac,it's Python 3.5) Double click on it. Right click on the IDLE icon,show package contents. Then go into the contents folder,then resources. Now,this is the important part: (Note: You must be the administrator or...
0
1
0
1
2009-09-14T23:28:00.000
11
0.01818
false
1,424,398
0
0
0
8
Does anyone know where or how to set the default path/directory on saving python scripts prior to running? On a Mac it wants to save them in the top level ~/Documents directory. I would like to specify a real location. Any ideas?
Default save path for Python IDLE?
53,340,799
2
9
28,611
0
python,python-idle
In Windows 10+, click the Windows Start button, then type idle, and then right-click on the IDLE desktop app and open the file location. This should bring you to the Start Menu shortcuts for Python, and you'll find a shortcut to IDLE there. Right-click on the IDLE shortcut and select properties. Set the "Start in" dire...
0
1
0
1
2009-09-14T23:28:00.000
11
0.036348
false
1,424,398
0
0
0
8
Does anyone know where or how to set the default path/directory on saving python scripts prior to running? On a Mac it wants to save them in the top level ~/Documents directory. I would like to specify a real location. Any ideas?
Default save path for Python IDLE?
43,900,532
1
9
28,611
0
python,python-idle
I am using windows 7 and by going to Start-> IDLE(Python 3.6 32-bit) The click on properties and then in the shortcut tab go to Start in and entering the desired path worked for me kindly note if IDLE is open and running while you do this you'll have to shut it down and restart it for this to work
0
1
0
1
2009-09-14T23:28:00.000
11
0.01818
false
1,424,398
0
0
0
8
Does anyone know where or how to set the default path/directory on saving python scripts prior to running? On a Mac it wants to save them in the top level ~/Documents directory. I would like to specify a real location. Any ideas?
Default save path for Python IDLE?
5,161,261
2
9
28,611
0
python,python-idle
It seems like you can get idle into the directory you want if you run any module from that directory. I had previously tried opening idlemain.py through the path browser. I was able to open and edit the file, but it seemed like I wasn't able to save my modifications. I'm just glad to hear other people are having this ...
0
1
0
1
2009-09-14T23:28:00.000
11
0.036348
false
1,424,398
0
0
0
8
Does anyone know where or how to set the default path/directory on saving python scripts prior to running? On a Mac it wants to save them in the top level ~/Documents directory. I would like to specify a real location. Any ideas?
Default save path for Python IDLE?
1,424,722
1
9
28,611
0
python,python-idle
On Windows (Vista at least, which is what I'm looking at here), shortcut icons on the desktop have a "Start in" field where you can set the directory used as the current working directory when the program starts. Changing that works for me. Anything like that on the Mac? (Starting in the desired directory from the c...
0
1
0
1
2009-09-14T23:28:00.000
11
0.01818
false
1,424,398
0
0
0
8
Does anyone know where or how to set the default path/directory on saving python scripts prior to running? On a Mac it wants to save them in the top level ~/Documents directory. I would like to specify a real location. Any ideas?
Default save path for Python IDLE?
1,424,502
0
9
28,611
0
python,python-idle
If you locate the idlelib directory in your Python install, it will have a few files with the .def extension. config-main.def has instructions on where to put the custom config files. However, looking through these I did not find any configurable paths (your install may vary). Looks like you might need to crack open th...
0
1
0
1
2009-09-14T23:28:00.000
11
0
false
1,424,398
0
0
0
8
Does anyone know where or how to set the default path/directory on saving python scripts prior to running? On a Mac it wants to save them in the top level ~/Documents directory. I would like to specify a real location. Any ideas?
Default save path for Python IDLE?
1,424,507
1
9
28,611
0
python,python-idle
If you open a module, that sets the default working directory. Start IDLE. File -> Open to open your file. And set the current working directory.
0
1
0
1
2009-09-14T23:28:00.000
11
0.01818
false
1,424,398
0
0
0
8
Does anyone know where or how to set the default path/directory on saving python scripts prior to running? On a Mac it wants to save them in the top level ~/Documents directory. I would like to specify a real location. Any ideas?
Proxy for Google App Engine
1,427,324
1
2
5,503
0
python,google-app-engine,proxy
SOCKS is not an HTTP-based protocol, so it's not possible to write a SOCKS proxy on App Engine. Edit: Note I wrote the above when you were specifically referring to a SOCKS proxy. Regarding general HTTP proxy servers, you can't really do that on App Engine, either, because proxies need to be able to accept requests for...
0
1
0
0
2009-09-15T12:08:00.000
3
0.066568
false
1,426,779
0
0
1
1
I am looking for a basic open source http proxy server for Google App Engine. Preferably written in Python. Any suggestions?
Finding the command for a specific PID in Linux from Python
1,440,965
0
8
9,565
0
python,linux,process
The proc filesystem exports this (and other) information. Look at the /proc/PID/cmd symlink.
0
1
0
1
2009-09-17T19:44:00.000
7
0
false
1,440,941
0
0
0
3
I'd like to know if it's possible to find out the "command" that a PID is set to. When I say command, I mean what you see in the last column when you run the command "top" in a linux shell. I'd like to get this information from Python somehow when I have a specific PID. Any help would be great. Thanks.
Finding the command for a specific PID in Linux from Python
1,443,544
5
8
9,565
0
python,linux,process
Look in /proc/$PID/cmdline, and then os.readlink() on /proc/$PID/exe. /proc/$PID/cmdline is not necessarily going to be correct, as a program can change its argument vector or it may not contain a full path. Three examples of this from my current process list are: avahi-daemon: chroot helper qmgr -l -t fifo -u /usr/sb...
0
1
0
1
2009-09-17T19:44:00.000
7
0.141893
false
1,440,941
0
0
0
3
I'd like to know if it's possible to find out the "command" that a PID is set to. When I say command, I mean what you see in the last column when you run the command "top" in a linux shell. I'd like to get this information from Python somehow when I have a specific PID. Any help would be great. Thanks.
Finding the command for a specific PID in Linux from Python
1,440,969
6
8
9,565
0
python,linux,process
Look in /proc/$PID/cmdline
0
1
0
1
2009-09-17T19:44:00.000
7
1
false
1,440,941
0
0
0
3
I'd like to know if it's possible to find out the "command" that a PID is set to. When I say command, I mean what you see in the last column when you run the command "top" in a linux shell. I'd like to get this information from Python somehow when I have a specific PID. Any help would be great. Thanks.
Python execute program change path
1,442,077
3
1
3,173
0
python,path,executable
You can change the current directory of your script with os.chdir(). You can also set environment variables with os.environ
0
1
0
0
2009-09-18T00:22:00.000
3
1.2
true
1,442,024
1
0
0
1
I'm trying to make a Python script run another program from its own path. I've got the execution of the other program working using os.system, but the program will crash because it cannot find its resources (wrong path, I assume). I tried adding the folder harboring the executable to the path, but that didn't help.
How to get the name of a running Python script?
1,451,204
10
12
16,150
0
python
It depends on what you mean by "a running python script". __file__ will give you the name of the currently executing file. If that's a module, you'll get where it was imported from e.g. blahblah.pyc sys.argv[0] will give you the name of the script that is being run, even if called from a module that that script importe...
0
1
0
0
2009-09-20T06:59:00.000
6
1
false
1,450,478
1
0
0
2
How do I get the name of a running Python script? I tried os.__file__ but that returns the name of the file where os resides.
How to get the name of a running Python script?
1,450,484
1
12
16,150
0
python
sys.argv[0] should give you the name of the script.
0
1
0
0
2009-09-20T06:59:00.000
6
0.033321
false
1,450,478
1
0
0
2
How do I get the name of a running Python script? I tried os.__file__ but that returns the name of the file where os resides.
Detecting symlinks (mklink) on Vista/7 in Python without Pywin32
4,610,520
0
4
1,727
0
python,windows,windows-vista,pywin32
You could leverage the Tcl you have available with Tkinter, as that has a 'file link' command that knows about junctions, unlike Pythons os module.
0
1
0
0
2009-09-20T22:06:00.000
5
0
false
1,452,148
0
0
0
1
Currently the buildout recipe collective.recipe.omelette uses junction.exe on all versions of Windows to create symlinks. However junction.exe does not come with Windows by default and most importantly does not support creating symlinks to files (only directories) which causes a problem with quite a few Python packages...
Nose unable to find tests in ubuntu
1,579,787
110
54
20,517
0
python,nose
The other thing which always gets me with nose is that it won't run tests in executable files. I'm not exactly sure why that would make a difference across Mac/Ubuntu, but it's worth a shot. Make sure that the scripts didn't somehow get chmod +x'd on the Mac… And if they did, fix them with chmod -x $(find tests/ -name ...
0
1
0
0
2009-09-21T21:55:00.000
7
1
false
1,457,104
0
0
0
2
Is there any reason why Nose wouldn't be able to find tests in Ubuntu 9.04? I'm using nose 0.11.1 with python 2.5.4. I can run tests only if I explicitly specify the filename. If I don't specify the filename it just says, 0 tests. The same project runs tests fine on my Mac, so I'm quite stumped!
Nose unable to find tests in ubuntu
47,909,167
2
54
20,517
0
python,nose
Use the -all-modules and it will find all the tests. nosetests --all-modules ./tests
0
1
0
0
2009-09-21T21:55:00.000
7
0.057081
false
1,457,104
0
0
0
2
Is there any reason why Nose wouldn't be able to find tests in Ubuntu 9.04? I'm using nose 0.11.1 with python 2.5.4. I can run tests only if I explicitly specify the filename. If I don't specify the filename it just says, 0 tests. The same project runs tests fine on my Mac, so I'm quite stumped!
Install python 2.6 in CentOS
1,465,105
25
87
189,056
0
python,centos,rpath
No, that's it. You might want to make sure you have all optional library headers installed too so you don't have to recompile it later. They are listed in the documentation I think. Also, you can install it even in the standard path if you do make altinstall. That way it won't override your current default "python".
0
1
0
0
2009-09-23T09:53:00.000
15
1
false
1,465,036
1
0
0
1
I have a shell that runs CentOS. For a project I'm doing, I need python 2.5+, but centOS is pretty dependent on 2.4. From what I've read, a number of things will break if you upgrade to 2.5. I want to install 2.5 separately from 2.4, but I'm not sure how to do it. So far I've downloaded the source tarball, untarred it,...