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
What is the best Google App Engine blobstore workflow?
4,775,721
0
3
681
0
python,google-app-engine,forms,file-upload,blobstore
The solution I've come up with for this is not the prettiest but it gets the job done. On the upload view (view that is specified in the create_upload_url function) I'm passing the post variables to the same form class from the first page. If the form is valid I'm saving the variables along with the BlobInfo.key to the...
0
1
0
0
2011-01-21T21:46:00.000
1
0
false
4,764,129
0
0
1
1
What is the best workflow for uploading file to the blobstore while saving information about the blob and other fields to a model record? For example, should I submit the form to the blobstore upload url (blobstore.create_upload_url), clean the form, redirect if errors and save and redirect if not? What is the best w...
Good way to generate GUIDs on app engine?
4,764,511
0
8
3,107
0
python,google-app-engine,guid
Any chance they are guid's for things you're storing in the datastore? If so, I believe object.key is a GUID
0
1
0
0
2011-01-21T22:26:00.000
5
0
false
4,764,474
0
0
1
1
I was wondering if anyone knows of a good way to generate GUIDs on python google app engine. I feel like there is a simple way that people are using, what would you suggest.
Install packages to Python2.6
4,775,706
2
1
3,008
0
python,centos
python-devel won't help you, since it will only be available for 2.4. You will need to install the package from source with the appropriate version of Python, e.g. python2.6 setup.py install.
0
1
0
0
2011-01-23T15:09:00.000
5
1.2
true
4,774,505
1
0
0
2
I've just installed Python2.6 on CentOS 5. I have to type python26 to run it. If I type python I get the default Python 2.4. Now I need to build a package using python2.6, but it fails because it can't find python-devel. I know python-devel is installed for Python 2.4. How do I install python-devel (or other packages...
Install packages to Python2.6
4,774,534
0
1
3,008
0
python,centos
You can install a specific version of the package, such as: yum install python-devel-2.6.2-5.el6.i686 I don't know the exact package version, depends on your CentOS version.
0
1
0
0
2011-01-23T15:09:00.000
5
0
false
4,774,505
1
0
0
2
I've just installed Python2.6 on CentOS 5. I have to type python26 to run it. If I type python I get the default Python 2.4. Now I need to build a package using python2.6, but it fails because it can't find python-devel. I know python-devel is installed for Python 2.4. How do I install python-devel (or other packages...
Easiest way to share work between backend and front end
4,777,646
1
1
181
0
python,django,installation
Get him to set up a virtual machine on his Mac, using VMWare Fusion or Parallels, running the same operating system that you currently use for your back end. If he prefers developing using Mac tools he can do still that by sharing his local changes to the virtual machine via a shared directory.
0
1
0
0
2011-01-23T23:25:00.000
3
0.066568
false
4,777,262
0
0
1
2
Hey everyone, I am expanding my team and I have recently added an additional front end engineer on my site. I am currently using django to run my site but my site is using a lot of plugins, namely: django-celery, django-mailer, django-notification, and django-socialregistration. Let me describe my situation: He is us...
Easiest way to share work between backend and front end
4,777,381
0
1
181
0
python,django,installation
An alternative, if that's possible, would be to set up a testing/development environment on a machine with an OS you're familiar with, then install something like Dropbox on his local machine where he can develop the frontend code, and install Dropbox on that other environment with the backend components. Dropbox would...
0
1
0
0
2011-01-23T23:25:00.000
3
0
false
4,777,262
0
0
1
2
Hey everyone, I am expanding my team and I have recently added an additional front end engineer on my site. I am currently using django to run my site but my site is using a lot of plugins, namely: django-celery, django-mailer, django-notification, and django-socialregistration. Let me describe my situation: He is us...
using python 2.6?
4,778,706
4
5
657
0
python
2.6 will be around for a long time. There are many machines that still run even 2.4, so you're fine.
0
1
0
0
2011-01-24T04:35:00.000
4
0.197375
false
4,778,679
1
0
0
2
i have no way of upgrade to python 2.7 or 3.1 so i am stuck with python 2.6 on my ubuntu 10.04 machine. will i still be able to find host that supports python 2.6? is using python 2.6 still consider outdated or bad practice?
using python 2.6?
4,778,746
3
5
657
0
python
Python 2.6 will probably still be around for a while, as Python 2.7 was released only a few months ago. You can always use from __future__ import ... to make use of some of the newer features from Python 3.x
0
1
0
0
2011-01-24T04:35:00.000
4
0.148885
false
4,778,679
1
0
0
2
i have no way of upgrade to python 2.7 or 3.1 so i am stuck with python 2.6 on my ubuntu 10.04 machine. will i still be able to find host that supports python 2.6? is using python 2.6 still consider outdated or bad practice?
Python Console UI Suggestions
5,085,080
4
11
1,317
0
python,console-application,curses,urwid
urwid is a very complete UI interface and you can do almost everything. In fact, I'm developing an app using urwid. But, as Paulo Scardine said, dialog is a better choice for a wizard-like app.
0
1
0
0
2011-01-24T14:44:00.000
2
0.379949
false
4,783,308
0
0
0
2
I'm currently rewriting a perl console application that was using curses, and planning to implement it in Python. So far I've narrowed my library options to straight curses, urwid, and dialog. The application is basically an installer for an appliance that will accommodate basic configuration (network options, hostname...
Python Console UI Suggestions
4,783,572
2
11
1,317
0
python,console-application,curses,urwid
Dialog is very easy to use and a good choice for an installer using 'wizard-like' interface.
0
1
0
0
2011-01-24T14:44:00.000
2
0.197375
false
4,783,308
0
0
0
2
I'm currently rewriting a perl console application that was using curses, and planning to implement it in Python. So far I've narrowed my library options to straight curses, urwid, and dialog. The application is basically an installer for an appliance that will accommodate basic configuration (network options, hostname...
Running a Twisted Application in PyDev
4,871,001
3
3
2,436
0
python,eclipse,pydev,twisted.application
First off, thank you all so much for your kind and gracious support in this matter! The key to running a twisted application via the PyDev module of Eclipse is to define twistd.py as the Main Module in the Run Configuration. The following steps can be used: These instructions assume you can already run twisted applicat...
0
1
0
0
2011-01-25T14:34:00.000
1
0.53705
false
4,794,707
0
0
0
1
I would like to debug a Twisted Application (10.0.0) using the Eclipse (3.5.2) PyDev Module (1.6.4) and Python (2.6.5). To run the application from the command line I would specify the following: c:\python26\python c:\python26\scripts\twistd.py -ny mytwistedapp.py To accomplish this using PyDev I created a new PyDev ...
twisted.pair.ethernet vs iptables
4,799,871
1
0
441
0
python,ethernet,iptables
twisted.pair.ethernet will give you a little bit of the parsing, but it doesn't do anything for actually getting the data in the first place, nor putting it back on the network (if you don't filter it out). For that you need to talk to the tuntap system, which Twisted doesn't do anything with.
0
1
0
0
2011-01-25T20:42:00.000
1
1.2
true
4,798,596
0
0
0
1
I need to implement some low-level IP filtering/tracking. Typically I would use iptables for this, but since I am currently using twisted in a few projects I'd consider using it's ethernet library, if it's possible. Actually, I would prefer it (it's easier to deploy than iptables rules). Is it possible to use twisted...
How do I install a user-specific configuration file with the distribute python
4,799,345
5
1
304
0
python,configuration-files,distribute
Since the egg is hard to edit, it doesn't go in the egg. A user-editable configuration file goes in the user's HOME directory or a system-wide directory like /etc/myapp. Your app should search in a number of easy-to-find places. Follow the Linux guidelines for tracking down the .bashrc file for hints on how best to do...
0
1
0
0
2011-01-25T21:55:00.000
2
1.2
true
4,799,298
1
0
0
1
I'm creating a python package, and using distribute to package it as an egg. I'd like to install a user-editable configuration file for each user of my software. What is the best way to accomplish this? I'm using Python 2.6 and am targeting the Windows platform.
How do I flush everything from Celery?
4,803,074
7
2
724
0
python,django,celery
Have you tried to restart the celery service with --discard parameter ?
0
1
0
0
2011-01-26T09:09:00.000
1
1.2
true
4,802,807
0
0
1
1
I accidently added too many things to the queue, and now it froze. Can't get it to do anything else.
Automatic indexes for expando properties in the google app engine for python
4,812,503
4
3
663
0
python,google-app-engine,expando
All properties are automatically indexed for simple queries. Simple queries, in this case, are those that either: Use only equality filters, with no sort orders or inequality filters. Have an inequality filter or sort order on a single field, with no other filters. If you want to do more complex queries - such as one...
0
1
0
0
2011-01-26T17:46:00.000
1
1.2
true
4,807,957
0
0
1
1
The google app engine python sdk offers an Expando type object which can be used for adding dynamic properties to an object that can be persisted to the datastore. The app engine also requires that for any property on which the objects need to be searched or sorted, an index must be created before uploading the app to ...
How to fetch environment variables in Mac OS X using python?
4,808,924
1
3
9,575
0
python,macos,environment-variables,.profile
You can also the helper function os.getenv(varname[, value]) which will return the value of environment variable varname, and if it not present will return value which defaults to None
0
1
0
0
2011-01-26T19:08:00.000
4
0.049958
false
4,808,809
1
0
0
2
How can I lookup environment variables (e.g. export HG_USER from .profile) using python code in Mac OS X?
How to fetch environment variables in Mac OS X using python?
4,808,824
11
3
9,575
0
python,macos,environment-variables,.profile
os.environ is a dictionary containing all the environment variables. You need to import os before you can use it. So, for example HG_USER would be accessed by os.environ['HG_USER'].
0
1
0
0
2011-01-26T19:08:00.000
4
1.2
true
4,808,809
1
0
0
2
How can I lookup environment variables (e.g. export HG_USER from .profile) using python code in Mac OS X?
How can I profile pure dll?
4,809,972
1
2
1,019
0
c++,python,dll,profiling
You can't profile code that isn't running- that's the definition of profiling. You will need to build something that can run (an executable file) that links to the DLL and use that.
0
1
0
0
2011-01-26T20:58:00.000
2
0.099668
false
4,809,950
0
0
0
2
I have project that creates dlls. These dlls are invoked from python later by special plugin system blue-sky. So in this project it's very hard to build executable file, but I need profiling. Are there any profilers that can work with pure dlls? I've tried Intel Amplifier, Microsoft VS2008 profiler they don't work. I'...
How can I profile pure dll?
4,810,355
1
2
1,019
0
c++,python,dll,profiling
If your dll is loaded by Python then you need to profile the Python process. With the Microsoft profiler as long as all the .pdb files are present it should resolve symbols within the dll. Another option is to create an executable that loads and calls the functions you're interested in and then profile said executabl...
0
1
0
0
2011-01-26T20:58:00.000
2
1.2
true
4,809,950
0
0
0
2
I have project that creates dlls. These dlls are invoked from python later by special plugin system blue-sky. So in this project it's very hard to build executable file, but I need profiling. Are there any profilers that can work with pure dlls? I've tried Intel Amplifier, Microsoft VS2008 profiler they don't work. I'...
Difference between subprocess.Popen and os.system
4,813,317
67
166
139,683
0
python,subprocess,system
subprocess.Popen() is strict super-set of os.system().
0
1
0
0
2011-01-27T06:04:00.000
5
1
false
4,813,238
0
0
0
1
What is the difference between subprocess.Popen() and os.system()?
Remove dock icon for shell executable in Mac OS X?
25,462,666
0
0
1,221
0
python,macos,dock,cx-freeze
My app has some helper command-line tools in one of its frameworks. If the tools are stored in the framework’s executable directory, Mac OS X wants to show them in the Dock. Since the tools run quickly, this appears as a brief flash where all the other Dock icons move to make space for the new icon and then move back. ...
0
1
0
0
2011-01-27T10:52:00.000
2
0
false
4,815,384
0
0
0
2
I know you can remove the dock icon for an app by setting LSUIELEMENT = 1. I have an executable created by cx_freeze, which bundles a set of Python scripts into a single executable. How can I remove the dock icon, with or without using AppleScript?
Remove dock icon for shell executable in Mac OS X?
4,815,469
0
0
1,221
0
python,macos,dock,cx-freeze
Ordinary executables (i.e. command line tools) do not show up in the dock.
0
1
0
0
2011-01-27T10:52:00.000
2
0
false
4,815,384
0
0
0
2
I know you can remove the dock icon for an app by setting LSUIELEMENT = 1. I have an executable created by cx_freeze, which bundles a set of Python scripts into a single executable. How can I remove the dock icon, with or without using AppleScript?
dev_appserver.py doesn't recognize my files
14,570,507
2
1
2,131
0
python,google-app-engine
I had the same problem. Adding python.exe in front of dev_appserver.py solved the problem for me. c:\Programme\Python27\python.exe C:\Programme\Google\AppEngineSDK\google_appengine\dev_appserver.py MoviesBwu\
0
1
0
0
2011-01-28T00:17:00.000
3
0.132549
false
4,823,466
0
0
1
1
I'm trying to get a basic GAE tutorial to work with Windows 7. So far I have: Installed python 2.5.4 Installed the current GAE SDK Set my PATH varible to include python and the GAE Created a "hello, world" app with an app.yaml and main.py file as specified. When I call dev_appserver.py . in my app's directory or dev_...
Inside python code, how do I run a .sh script?
4,826,733
1
5
32,061
0
python,bash,shell
You can use os.system or subprocess.Popen or subprocess.call but when using subprocess methods make sure you use shell=True. And executing it via system call in all these methods is blocking. The python script will complete and then go the next step.
0
1
0
1
2011-01-28T09:36:00.000
3
0.066568
false
4,826,686
1
0
0
1
Will it continue the code after it's run? Or will it stop at that line until the script is done?
Override file operations in Python
4,835,903
0
2
1,152
0
python,filesystems
If you want to write the code of your own file system from scratch, one way or another you will end up rewriting a library. I have no knowledge of any library implementing an in-memory temporary file system in pure Python. As an alternative, in Linux you can use the tmpfs file system, usually mounted on /dev/shm. You c...
0
1
0
0
2011-01-29T06:56:00.000
4
0
false
4,835,603
1
0
0
3
Is there a way to override all file operations in Python? File operations such as 'open', 'os.rename' and 'os.unlink'. I want to create a temporary, in-memory file system without rewriting a library. Does anyone know of a script or a library that has this feature? I want to run a library on Google App Engine and it is ...
Override file operations in Python
4,835,941
0
2
1,152
0
python,filesystems
I found this which may be close enough to do the job code.google.com/p/pyfilesystem
0
1
0
0
2011-01-29T06:56:00.000
4
0
false
4,835,603
1
0
0
3
Is there a way to override all file operations in Python? File operations such as 'open', 'os.rename' and 'os.unlink'. I want to create a temporary, in-memory file system without rewriting a library. Does anyone know of a script or a library that has this feature? I want to run a library on Google App Engine and it is ...
Override file operations in Python
4,835,828
1
2
1,152
0
python,filesystems
"Override"? That word doesn't really make any sense in that context. You can replace them in various ways, depending on what you want really. Making a in memory file system can be done on most OS's through the operating system, like with tmpfs in most Unices. That's probably a better solution for you.
0
1
0
0
2011-01-29T06:56:00.000
4
0.049958
false
4,835,603
1
0
0
3
Is there a way to override all file operations in Python? File operations such as 'open', 'os.rename' and 'os.unlink'. I want to create a temporary, in-memory file system without rewriting a library. Does anyone know of a script or a library that has this feature? I want to run a library on Google App Engine and it is ...
[Errno 32]Broken pipe in Python Script in Crontab
4,851,152
1
2
1,316
0
python
Hi I dnt know y the error occurs but when i directed the print statements from my script to another file this error did not come and my script ran successfully Example: Myscript.py > test.log
0
1
0
1
2011-01-29T10:49:00.000
1
0.197375
false
4,836,450
0
0
0
1
I am running a Python script which downloads PDF files from the FTP. The script when run manually works perfectly but when i put it in crontab in my ubuntu machine and execute it i get a an error [Errno 32] Broken pipe. Any idea why this happens and how do i handle this?
STDIN or file as mapper input in Hadoop environment?
4,839,045
1
1
3,305
0
python,hadoop,mapreduce
Hadoop streaming has to take input from STDIN. I think the confusion you're having is you're trying to write code to do some of the things that Hadoop Streaming is doing for you. I did that when I first started Hadooping. Hadoop streaming can read in multiple files and even multiple zipped files which it then parses, ...
0
1
0
0
2011-01-29T16:48:00.000
1
0.197375
false
4,838,074
0
0
0
1
As we need to read in bunch of files to mapper, in non-Hadoop environment, I use os.walk(dir) and file=open(path, mode) to read in each file. However, in Hadoop environment, as I read that HadoopStreaming convert file input to stdin of mapper and conver stdout of reducer to file output, I have a few questions abou...
Import error when trying to access sdk datastore admin
4,841,024
2
1
769
0
python,google-app-engine
Use from django.utils import simplejson. dev_appserver mimics the production environment. Nothing you install at the system level will be available for import to your scripts, to avoid imports working fine in your testing and then failing spectacularly when you deploy. However, you don't need to bundle this particula...
0
1
0
0
2011-01-29T22:04:00.000
3
0.132549
false
4,839,749
0
0
1
2
I'm getting a "ImportError: No module named simplejson" when trying to access datastore admin on the development server. After the first time I got this error I installed the simplejson package from slackbuilds (i'm on Slackware). It seems to be working normally, I could import the simplejson module with no errors on t...
Import error when trying to access sdk datastore admin
27,462,399
0
1
769
0
python,google-app-engine
If it in app engine SDK's lib, e.g on Mac it's /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/ Copy it over to app's dir would work. It's better than pip install and then copy over, which may contain c-extension. The modules in SDK's l...
0
1
0
0
2011-01-29T22:04:00.000
3
0
false
4,839,749
0
0
1
2
I'm getting a "ImportError: No module named simplejson" when trying to access datastore admin on the development server. After the first time I got this error I installed the simplejson package from slackbuilds (i'm on Slackware). It seems to be working normally, I could import the simplejson module with no errors on t...
setup.py and adding file to /bin/
9,478,011
15
81
48,656
0
python
If you're willing to build and install the entire python package, this is how I would go about it: Edit the setup() function in setup.py to contain a parameter named scripts and set its argument as the location of the file(s) you wish to run from anywhere. e.g. setup(name='myproject',author='',author_email='',script...
0
1
0
0
2011-01-29T23:41:00.000
4
1
false
4,840,182
1
0
0
1
I can't figure out how to make setup.py add a scrip to the the user's /bin or /usr/bin or whatever. E.g., I'd like to add a myscript.py to /usr/bin so that the user can call myscript.py from any directory.
DIsable Python module
4,842,172
1
5
3,339
0
python
As @Thomas points out, blacklisting is a pretty poor mechanism for implementing any security mechanisms. Whitelisting is a much safer approach. But a mechanism inside the interpreter isn't particularly excellent for any number of reasons: flaws in the interpreter that are exploitable at the source code level would allo...
0
1
0
1
2011-01-30T09:03:00.000
1
1.2
true
4,842,049
0
0
0
1
Is there any way to disable a module from being loaded on my system? Let's say i would like to restrict my users from accessing the subprocess or popen2 module. Something like PHP's 'disabled_functions' or any similar method to achieve the same thing.
bat script linking to python script
4,859,343
0
1
610
0
python,windows-xp,batch-file,hyperlink,symlink
When doing something similar for myself, I just created a few more batch files. For example, you could provide a py_go.bat to invoke python theLongestPythonScriptNameInTheWorld.py
0
1
0
0
2011-02-01T05:37:00.000
3
0
false
4,859,291
0
0
0
1
I have a .bat that sets up an environment which allows users to execute several python scripts for specific jobs. My goal is to create links to the scripts. For example, the user runs the .bat, a cmd window pops up, and instead of typing python theLongestPythonScriptNameInTheWorld.py he types python go. My target platf...
How can you limit the allowed execution time of specific methods in the python version of Google App Engine?
4,862,285
0
4
257
0
python,google-app-engine
In loops, you can store the time the loop started and check how long it's been going on each iteration. If you're not in a loop, things are a bit trickier. You could add the time-checking bit every few lines of code. This, of course, makes for really ugly code, but without the ability to spawn threads that could run a...
0
1
0
0
2011-02-01T06:46:00.000
2
0
false
4,859,734
0
0
1
1
Since the signal module is not supported in the python version of Google App Engine, what is the simplest way to call a method and throw/catch an exception if the method does not return in less than 2 seconds?
Check if the directory content has changed with shell script or python
4,862,410
1
6
4,757
0
python,shell,latex
Not much of a python man myself. But in a pinch, assuming you're on linux, you could periodically shell out and "ls -lrt /path/to/directory" (get the directory contents and sort by last modified), and compare the results of the last two calls for a difference. If so, then there was a change. Not very detailed, but gets...
0
1
0
1
2011-02-01T12:08:00.000
7
0.028564
false
4,862,346
0
0
0
1
I have a program that create files in a specific directory. When those files are ready, I run Latex to produce a .pdf file. So, my question is, how can I use this directory change as a trigger to call Latex, using a shell script or a python script? Best Regards
Python bluetooth transfer speed?
4,863,792
-1
0
1,146
0
python,bluetooth
You need a binding for the Bluetooth driver/OS service that handles the Bluetooth device. Most drivers are written in C, some in C++. If you can get the source code/API or if it's provided you might be able to access it from python. You might need to code some custom binding to your OS service to do so.
0
1
0
1
2011-02-01T14:27:00.000
3
-0.066568
false
4,863,727
0
0
0
2
In Python, am using the LightBlue module for Bluetooth connectivity. How do I get the speed at which I am sending file to my phone from my laptop (Ubuntu)?
Python bluetooth transfer speed?
4,870,002
0
0
1,146
0
python,bluetooth
The simplest solution is to figure out how large the file is, capture the system time before the transfer and after the transfer, and then do the math. To compute a more fine-grained transfer rate that changes over the course of the transfer, you would need to use the size of your transmit buffers and the time interval...
0
1
0
1
2011-02-01T14:27:00.000
3
0
false
4,863,727
0
0
0
2
In Python, am using the LightBlue module for Bluetooth connectivity. How do I get the speed at which I am sending file to my phone from my laptop (Ubuntu)?
Python 2.7.1 can't see Twisted
4,869,690
3
1
2,965
0
python,bash,osx-snow-leopard,twisted,.bash-profile
You'll need to install Twisted into your Python 2.7 installation somehow. The "2.6" in that path should be a hint that you shouldn't be trying to tell Python 2.7 about it. Among other things: Extension modules are not compatible between python versions. You may get a segfault if you try to use them. Bytecode forma...
0
1
0
0
2011-02-01T23:46:00.000
4
1.2
true
4,869,315
0
0
0
3
I have a new MacBook Pro running OS X 10.6.6 / Snow Leopard -- which ships with Python 2.6, although I have installed 2.7.1 Unfortunately, this doesn't seem to see the Twisted install in the 2.6/Extras/lib/python/twisted directory, as I find I'm unable to import modules that I can see are present in that directory. "wh...
Python 2.7.1 can't see Twisted
4,869,359
2
1
2,965
0
python,bash,osx-snow-leopard,twisted,.bash-profile
Create an environment using virtualenv. Install Twisted in your newly created environment using pip.
0
1
0
0
2011-02-01T23:46:00.000
4
0.099668
false
4,869,315
0
0
0
3
I have a new MacBook Pro running OS X 10.6.6 / Snow Leopard -- which ships with Python 2.6, although I have installed 2.7.1 Unfortunately, this doesn't seem to see the Twisted install in the 2.6/Extras/lib/python/twisted directory, as I find I'm unable to import modules that I can see are present in that directory. "wh...
Python 2.7.1 can't see Twisted
4,869,332
3
1
2,965
0
python,bash,osx-snow-leopard,twisted,.bash-profile
You'll have to install twisted using python 2.7. Also, python doesn't look up what's in the PATH variable for imports, it looks in PYTHONPATH. But just putting your python 2.6 folder in your pythonpath isn't a very good solution.
0
1
0
0
2011-02-01T23:46:00.000
4
0.148885
false
4,869,315
0
0
0
3
I have a new MacBook Pro running OS X 10.6.6 / Snow Leopard -- which ships with Python 2.6, although I have installed 2.7.1 Unfortunately, this doesn't seem to see the Twisted install in the 2.6/Extras/lib/python/twisted directory, as I find I'm unable to import modules that I can see are present in that directory. "wh...
Memcache not present in App-Engine-Patch?
4,870,311
1
1
1,200
0
google-app-engine,memcached,app-engine-patch,python-memcached
It looks like you're attempting to make a memcache call at import time. Judging from the stacktrace, Django imports your modules before it sets up the App Engine environment, and therefore any calls to App Engine services at the module level will fail on the development server. Move the call to memcache inside a functi...
0
1
0
0
2011-02-02T02:03:00.000
1
1.2
true
4,870,102
0
0
1
1
I'm trying to store a date into memcache using the following code: from datetime import date from google.appengine.api.memcache import Client MEMCACHE_DATE_KEY = 'date' client = Client() def last_date(): return client.get(MEMCACHE_DATE_KEY) def new_date(): client.set(MEMCACHE_DATE_KEY, date.today()) I am ...
Considerations for moving our web app to an appliance
4,872,968
0
3
124
0
python,appliance
It depends on what langauge/tecnology application is written. If it is java, release war file + tomcat/jboss. If it is python, release eggs. If it is php... not sure, probably just .tar.bz2. Linux distro or virtual image mught be advantage, but I dislike using them, because they are usually does not fits to my infra (w...
0
1
0
1
2011-02-02T09:33:00.000
2
0
false
4,872,722
0
0
1
1
We have developed a web application running on Linux that is quite popular. We now wish to release it as an appliance so customers can run it internally on their own networks. We are unsure of the best approach. We are flexible on areas such as: the Linux distro, whether it's a hardware or software only appliance. Doe...
Where is the most authoritative/complete source of documentation on rpm-python module?
4,935,001
0
1
658
0
python,rpm,rhel5
If you are on RHEL then you could seriously consider using the yum APIs instead of rpm-python directly ... the API is much easier to use.
0
1
0
1
2011-02-02T22:45:00.000
3
0
false
4,880,818
1
0
0
1
Trying to learn how to use the rpm-python module (i.e. "import rpm" on RHEL5). I can't find any tutorials that are complete or recent. Specifically regarding how to install and manage rpm's on a system. Anyone?
How can I add python to cmd in windows
19,559,108
15
13
46,626
0
python,windows,python-3.x
Right click on my computer>got to properties>advanced settings>environmental variables> choose path and add the installed python dirtory to that path as like below: C:\WINDOWS\system32;C:\WINDOWS;C:\Python27
0
1
0
0
2011-02-03T05:27:00.000
2
1
false
4,882,808
1
0
0
1
I have python 3.1 installed, and I have added it to the system path too. Now I can open "cmd" and type python to start python, but whenever I try to open cmd in a specific directory by using (shift + right click -> open command prompt here), and type python, it says "command not found"! How can I fix this?
access denied in python
4,883,551
1
1
757
0
python
you have to start the process as root. You can run "sudo yourscript.py" as your normal user account or log in as root or run "su -" to become root and then run your script. Your script cannot obtain root privileges after it starts running. That's just not how unix/linux systems work.
0
1
0
0
2011-02-03T07:41:00.000
2
0.099668
false
4,883,541
0
0
0
1
hi everybody i wanna take a dir from one directory and os doesn't allow me to do this work(for example /etc/openvpn in linux) and i know i should be root but i don't know how can i do this with python.
Can I catch error codes when using Fabric to run() calls in a remote shell?
4,888,891
4
70
44,680
0
python,error-handling,fabric
Apparently messing with the environment is the answer. fabric.api.settings can be used as a context manager (with with) to apply it to individual statements. The return value of run(), local() and sudo() calls isn't just the output of the shell command, but also has special properties (return_code and failed) that allo...
0
1
0
1
2011-02-03T16:11:00.000
4
0.197375
false
4,888,568
0
0
0
1
Normally Fabric quits as soon as a run() call returns a non-zero exit code. For some calls, however, this is expected. For example, PNGOut returns an error code of 2 when it is unable to compress a file. Currently I can only circumvent this limitation by either using shell logic (do_something_that_fails || true or do_s...
Python script - connect to SSH and run command
39,664,919
1
10
74,237
0
python,automation,ssh,telnet
There are many libraries to do that. Subprocess Pexpect Paramiko (Mostly used) Fabric Exscript You can check their documentation for the implementation.
0
1
1
1
2011-02-04T10:12:00.000
7
0.028564
false
4,896,785
0
0
0
1
I already know there are ssh modules for Python, that's not for what I'm looking for. What I want to have is an python script to do the following: > connect to an [ input by user ] SSH host > connect using the credentials [ provided by the user ] > run command on the SSH host [ telnet to [host - input by user ] > Sele...
highlighting a window in GNOME's window list
4,906,739
1
1
495
0
python,perl,gtk
I'm not really into GTK programming, but as far as i know you want to set an "URGENT"-Flag for the Window which should be highlighted. Maybe this will get you any further. :)
1
1
0
0
2011-02-05T10:51:00.000
2
0.099668
false
4,906,424
0
0
0
1
In order to indicate activity, some applications (e.g. Pidgin) highlight their entry in GNOME's Window List panel widget (e.g. via bold font or flashing color). This indication is reset automatically when the window is activated. I have a terminal application for which I would like to achieve the same thing (preferably...
Windows Gstreamer ALSA Alternative?
4,925,220
0
2
2,273
0
python,windows,gstreamer,alsa
9000's answer, sdl, and autoaudiosrc/sink are the answer :)
0
1
0
0
2011-02-05T15:49:00.000
4
0
false
4,907,828
0
0
0
3
Does anyone know an alternative to ALSA that can be used on windows, with gstreamer, and how to install it, and where to find python bindings for it if it needs it? thanks xxx
Windows Gstreamer ALSA Alternative?
4,907,925
0
2
2,273
0
python,windows,gstreamer,alsa
It seems that on Windows the SDK installer doesn't actually install the bindings to any location visible to the Python interpreter. You can find the files at sdk\bindings\python\v2.6\lib\site-packages. Copy the contents of the directory to your Python installation's site-packages, and you should be able to import the l...
0
1
0
0
2011-02-05T15:49:00.000
4
0
false
4,907,828
0
0
0
3
Does anyone know an alternative to ALSA that can be used on windows, with gstreamer, and how to install it, and where to find python bindings for it if it needs it? thanks xxx
Windows Gstreamer ALSA Alternative?
5,058,755
3
2
2,273
0
python,windows,gstreamer,alsa
SDL does a decent job of abstracting sound interfaces in a platform-independent way. PyGame contains an interface to SDL and works on many platforms. Such abstraction, of course, sets many limitations, but maybe it will still do for you. Converted from a comment.
0
1
0
0
2011-02-05T15:49:00.000
4
1.2
true
4,907,828
0
0
0
3
Does anyone know an alternative to ALSA that can be used on windows, with gstreamer, and how to install it, and where to find python bindings for it if it needs it? thanks xxx
Apache Config - Multiple python versions
29,809,235
2
2
2,129
0
python,apache
To use with Python 3, you need to install the right mod_wsgi for python 3. On Debian or Ubuntu : sudo apt-get install libapache2-mod-wsgi-py3. For older versions of Python, when installing mod_wsgi, type : ./configure --with-python=/usr/local/bin/python2.5 for version 2.5 for instance.
0
1
0
1
2011-02-07T22:59:00.000
3
0.132549
false
4,927,688
1
0
0
3
I have a couple versions of python on my box. My app uses python 2.7 which is found in /usr/local/bin/python. Apache seems to be using an earlier version in /usr/bin/python. How can I configure Apache to use a later version of Python for my app?
Apache Config - Multiple python versions
4,928,096
0
2
2,129
0
python,apache
I could be mistaking, but whatever user apache is started with has a profile which likely has the search path in it. You could change the search path to search /usr/local/bin before /usr/bin, though this is not an ideal approach. Whatever default shell is set for the account used by Apache, just check that you have an ...
0
1
0
1
2011-02-07T22:59:00.000
3
0
false
4,927,688
1
0
0
3
I have a couple versions of python on my box. My app uses python 2.7 which is found in /usr/local/bin/python. Apache seems to be using an earlier version in /usr/bin/python. How can I configure Apache to use a later version of Python for my app?
Apache Config - Multiple python versions
4,927,767
1
2
2,129
0
python,apache
You can't. Either rebuild mod_wsgi against the other version of Python, or change the shebang line in your CGI scripts to the other executable.
0
1
0
1
2011-02-07T22:59:00.000
3
1.2
true
4,927,688
1
0
0
3
I have a couple versions of python on my box. My app uses python 2.7 which is found in /usr/local/bin/python. Apache seems to be using an earlier version in /usr/bin/python. How can I configure Apache to use a later version of Python for my app?
How to install easy_install in Python 2.7.1 on Windows 7
28,389,353
0
30
125,598
0
python,easy-install
I know this isn't a direct answer to your question but it does offer one solution to your problem. Python 2.7.9 includes PIP and SetupTools, if you update to this version you will have one solution to your problem.
0
1
0
0
2011-02-08T06:29:00.000
7
0
false
4,930,216
1
0
0
1
I have installed Python 2.7.1 on Windows 7, but I am unable to install easy_install. Please help me.
Change Bluetooth name Python
4,931,264
1
0
1,096
0
python,bluetooth,ubuntu-10.10
Invoke org.bluez.Adapter.SetProperty(u'Name', u'New name here') in the /org/bluez/<pid>/<device> object path on the org.bluez D-Bus bus.
0
1
0
1
2011-02-08T09:10:00.000
1
1.2
true
4,931,244
0
0
0
1
I'm using PyBluez on Ubuntu 10.10. I would like to know how is possible to change the bluetooth name of the local device in software. I couldn't find any command related..
How to periodically create an HTTP POST request from windows
4,955,373
1
1
2,416
0
python,http,windows-services,scheduled-tasks
This is trivially easy with a scheduled task which is the native Windows way to schedule tasks! There's no need for cygwin or Python or anything like that. I have such a task running on my machine which pokes my Wordpress blog every few hours. The script is just a .bat file which calls wget. The task is configured to "...
0
1
1
0
2011-02-08T15:56:00.000
3
0.066568
false
4,935,257
0
0
0
2
I need to install on one of my Windows PC's some software that will periodically send a short HTTP POST request to my remote development server. The request is always the same and should get sent every minute. What would you recommend as the best approach for that? The things I considered are: 1. Creating a Windows ser...
How to periodically create an HTTP POST request from windows
4,935,443
2
1
2,416
0
python,http,windows-services,scheduled-tasks
If you have cygwin, you probably have cron - run a python script from your crontab.
0
1
1
0
2011-02-08T15:56:00.000
3
0.132549
false
4,935,257
0
0
0
2
I need to install on one of my Windows PC's some software that will periodically send a short HTTP POST request to my remote development server. The request is always the same and should get sent every minute. What would you recommend as the best approach for that? The things I considered are: 1. Creating a Windows ser...
Detecting Type of Video Stream
4,935,406
1
0
281
0
python,bash,streaming,video-streaming,multimedia
what about trying pyffmpeg out. you should be able to get the container info from that.
0
1
0
0
2011-02-08T16:08:00.000
1
1.2
true
4,935,387
0
0
0
1
I have 2 video streams (1) VLC Generated Compressed MP4 UDP stream (2) DV Uncompressed UDP Stream Both are destined to a host. At this Unix receiving host, I would like to detect type of stream coming using Bash or Python Scripting (without tcpdump, I do not have root priv.) ANY idea guys how to implement ? Thank you.
Is it possible to deploy a Python application on the Mac App Store?
4,971,779
1
49
14,346
0
python,macos,app-store,py2app
Apple provides the Build Applet tool for Python with Xcode so it should be supported by the App store. MacOS X 10.6.6 includes Python 2.5 and 2.6 as part of the default install, you can specify /usr/bin/python2.5 and /usr/lib/python2.5.
0
1
0
0
2011-02-09T00:45:00.000
6
0.033321
false
4,940,273
1
0
0
2
Does Apple accept Python applications for distribution on the new Mac App Store? If so, how should the application be packaged? Is py2app sufficient? Something else?
Is it possible to deploy a Python application on the Mac App Store?
4,993,464
9
49
14,346
0
python,macos,app-store,py2app
I know it's possible because I know of at least one Python-based app that is in the app store ("Pennywise", which is based on my own app, moneyGuru, which uses Python + PyObjc + py2app). I didn't do it myself, so I'm not sure of the details.
0
1
0
0
2011-02-09T00:45:00.000
6
1
false
4,940,273
1
0
0
2
Does Apple accept Python applications for distribution on the new Mac App Store? If so, how should the application be packaged? Is py2app sufficient? Something else?
How to run programs in python2 and python3
4,940,647
0
9
44,324
0
python
The shell will read the PATH from left to right, so you most likely defined Python 3.1.3 before Python 2.6.6. Specify the full path for each to use both versions.
0
1
0
0
2011-02-09T02:02:00.000
6
0
false
4,940,617
1
0
0
3
I have python 2.6.6 and python 3.1.3 currently installed on my machine (Windows Vista 64 bit) My path variable includes the directory of both versions. How can I specify which python I want to run a program in. For instance, if I want to run a program in python 3, it works but if I want to run a different program in py...
How to run programs in python2 and python3
4,940,652
8
9
44,324
0
python
You can specify the version in the executable name python2.6 and python3.
0
1
0
0
2011-02-09T02:02:00.000
6
1.2
true
4,940,617
1
0
0
3
I have python 2.6.6 and python 3.1.3 currently installed on my machine (Windows Vista 64 bit) My path variable includes the directory of both versions. How can I specify which python I want to run a program in. For instance, if I want to run a program in python 3, it works but if I want to run a different program in py...
How to run programs in python2 and python3
4,940,631
6
9
44,324
0
python
Instead of just typing "python" on the command line, use the full path the python.exe that you want to run: FULL_PATH_TO_PYTHON_2.6.6\python.exe or FULL_PATH_TO_PYTHON_3.1.3\python.exe should distinguish between the two.
0
1
0
0
2011-02-09T02:02:00.000
6
1
false
4,940,617
1
0
0
3
I have python 2.6.6 and python 3.1.3 currently installed on my machine (Windows Vista 64 bit) My path variable includes the directory of both versions. How can I specify which python I want to run a program in. For instance, if I want to run a program in python 3, it works but if I want to run a different program in py...
Removing duplicated lines from a txt file
4,948,705
1
5
7,337
0
python,linux,awk
Since you need the extra bits the fastest way is to create a set of unique entries (sort -u will do) and then you must compare each entry against each other, e.g. if x.startswith(y) and not y.startswith(x) and just leave x and discard y.
0
1
0
0
2011-02-09T17:46:00.000
8
0.024995
false
4,948,509
1
0
0
1
I am processing large text files (~20MB) containing data delimited by line. Most data entries are duplicated and I want to remove these duplications to only keep one copy. Also, to make the problem slightly more complicated, some entries are repeated with an extra bit of info appended. In this case I need to keep the e...
FTP filename encoding
5,210,013
2
1
3,170
0
python,encoding,ftp,twisted
FTP ignores encodings; as long as a filename does not contain a '\0' (null character) and '/' (slash) separates directories, it happily accepts anything. Do your own decoding and encoding of the filenames. It is quite probable that the encoding used in your example is "cp1252", which is the “Windows Western” or somethi...
0
1
0
1
2011-02-11T08:12:00.000
2
0.197375
false
4,966,856
0
0
0
1
Hi I use twisted library to connect to FTP server but I have problem with filename encoding. I receive 'Illusion-N\xf3z.txt' so its not unicode. Is there any FTP command to force specific encoding? Thanks in advance! MK
Lexing and Parsing Utilities
4,992,038
1
5
1,406
0
python,ruby,parsing,lexical-analysis,guile
NL text tends have to lots of ambiguity. If you want to parse natural langauge, I don't think any of the classic compiler-type parser generators (LALR, LL [including ANTLR]) will help you much, and compiler type parser generators typically don't handle this at all. A GLR parser, which does handle ambiguity, may be of...
0
1
0
0
2011-02-13T04:39:00.000
3
0.066568
false
4,982,455
0
0
0
1
I'm looking for lexical analysis and parser-generating utilities that are not Flex or Bison. Requirements: Parser is specified using a context-free LL(*) or GLR grammar. I would also consider PEGs. Integrates tightly with a programming language that could be used for both scripting and application development. Languag...
Python interpreter path search order on windows
4,984,297
0
0
453
0
python,path,interpreter
If you are having problems with PATH in windows, set the one you want to use at the start of the path variable. Plus, you might want to use User variables instead of system ones. But I don't know if that answers your question because you didn't really ask anything.
0
1
0
1
2011-02-13T12:27:00.000
2
0
false
4,984,124
1
0
0
1
Many applications include a python interpreter, so now when I try to run a program, Subversion's 2.5 interpreter is used to execute it. I've already changed environment path order, putting subversion's last. Now when I run python from command line, the 2.7 is run, but when I pass the script's filename, version 2.5 seem...
Merge and sync stdout and stderr?
4,984,598
1
5
3,540
0
python,subprocess,stdout,stderr
You can merge them passing subprocess.STDOUT as the stderr argument for subprocess.Popen, but I don't know if they will be formatted with time and source.
0
1
0
0
2011-02-13T14:02:00.000
2
0.099668
false
4,984,549
1
0
0
1
say I'm running an exe from a python script using: subprocess.call(cmdArgs,stdout=outf, stderr=errf) when outf and errf are file descriptors of text files. is there any way I can generate on top of it a merged and synced text file of both stdout and stderr? it should be formatted with time and source(our/err). thanks
Using pickle for in-memory "transaction"?
4,986,678
1
1
310
0
python,transactions,pickle,undo
Well, as you mentioned the data design is loosely coupled, so you I don't think you need to pickle it if it's in memory. Just take a copy of all the relevant variables, and the transaction.abort() would just copy them back, and transaction.commit() would then just remove the copy of the data. There are issues, but none...
0
1
0
0
2011-02-13T19:50:00.000
2
1.2
true
4,986,467
1
0
0
2
A user can perform an action, which may trigger dependent actions (which themselves may have dependent actions) and I want to be able to cancel the whole thing if the user cancels a dependent action. The typical way I've seen this done is some variant of an undo stack and each action will need to know how to undo itsel...
Using pickle for in-memory "transaction"?
4,986,707
1
1
310
0
python,transactions,pickle,undo
You can use pickle to store your state if all elements of state are serializable (usually they are). The only reasons for not doing so: if you have to store pointers to any objects that are not saved in state, you will have problems with these pointers after performing undo operation. this method could be expens...
0
1
0
0
2011-02-13T19:50:00.000
2
0.099668
false
4,986,467
1
0
0
2
A user can perform an action, which may trigger dependent actions (which themselves may have dependent actions) and I want to be able to cancel the whole thing if the user cancels a dependent action. The typical way I've seen this done is some variant of an undo stack and each action will need to know how to undo itsel...
Step by step setting up python with pip and virtualenv?
4,987,311
2
4
3,496
0
python
What problems? Install PIP: easy-install pip Install virtualenv: pip install virtualenv Create a virtualenv environment: virtualenv myenv Enter to environment: source myenv/bin/activate or use myenv/bin/python ??? PROFIT!
0
1
0
0
2011-02-13T21:11:00.000
2
0.197375
false
4,986,896
1
0
0
1
Are there any good step by step tutorials on setting up a Mac to use python, pip and virtualenv setup?
Modules between multiple versions of Python Linux
4,991,407
3
4
2,117
0
python
Don't attempt to share them; this has some chance of success with pure Python modules, but C modules will fail to work. Instead, install them using the appropriate interpreter executable, e.g. python2.4 setup.py install.
0
1
0
0
2011-02-14T11:02:00.000
2
0.291313
false
4,991,366
1
0
0
1
I have Python2.6.5 and Python2.4.4 on my linux machine. At the moment, all the modules I have (wx, ply, pyserial, twisted, to name a few) are installed for the 2.6 version of python. If I try to import wx on Python2.4, I get the expected no module error. The problem here, is that I have a lot of devices (Let's say ove...
running several system commands in parallel in Python
4,992,558
2
33
45,031
0
python
If your running system commands you can just create the process instances with the subprocess module, call them as you want. There shouldn't be any need to thread (its unpythonic) and multiprocess seems a tad overkill for this task.
0
1
0
0
2011-02-14T12:59:00.000
7
0.057081
false
4,992,400
1
0
0
1
I write a simple script that executes a system command on a sequence of files. To speed things up, I'd like to run them in parallel, but not all at once - i need to control maximum number of simultaneously running commands. What whould be the easiest way to approach this ?
Is there no way to serve a static directory and its children i Cherrypy?
4,994,618
1
0
357
0
python,cherrypy
Not sure in CherryPY, but why not configure your front end webserver to serve static files? You really don't want that traffic hitting your framework.
0
1
0
0
2011-02-14T16:20:00.000
2
0.099668
false
4,994,493
1
0
0
2
Using Cherrypy version 3.0.2 Given a file-structure like this: static-dir 2011 2010 2009 ... I use the configuration: '/static': {'tools.staticdir.on': True, 'tools.staticdir.dir': 'static-dir'} This works fine fore getting /static/anyfile But if I try /static/2009/anyfile I get an error. I can add an entry in...
Is there no way to serve a static directory and its children i Cherrypy?
4,997,347
1
0
357
0
python,cherrypy
You shouldn't have to enter multiple entries; it should descend as far down as you need to. What error are you getting? 404? If you're using Cherrypy 3.2, try setting 'tools.staticdir.debug' to True.
0
1
0
0
2011-02-14T16:20:00.000
2
1.2
true
4,994,493
1
0
0
2
Using Cherrypy version 3.0.2 Given a file-structure like this: static-dir 2011 2010 2009 ... I use the configuration: '/static': {'tools.staticdir.on': True, 'tools.staticdir.dir': 'static-dir'} This works fine fore getting /static/anyfile But if I try /static/2009/anyfile I get an error. I can add an entry in...
How to create a spinning command line cursor?
4,995,772
3
85
76,617
0
python,command-line-interface,progress
Sure, it's possible. It's just a question of printing the backspace character (\b) in between the four characters that would make the "cursor" look like it's spinning ( -, \, |, /).
0
1
0
0
2011-02-14T18:17:00.000
23
0.026081
false
4,995,733
1
0
0
1
Is there a way to print a spinning cursor in a terminal using Python?
How to just call a command and not get its output
4,996,861
3
40
60,925
0
python,subprocess
just call it as you are and tack >/dev/null on the end of the comamnd. That will redirect any textual output.
0
1
0
0
2011-02-14T20:22:00.000
4
0.148885
false
4,996,852
0
0
0
2
In Python, what is the shortest and the standard way of calling a command through subprocess but not bothering with its output. I tried subprocess.call however it seems to return the output. I am not bothered with that, I just need to run the program silently without the output cluttering up the screen. If it helps, I ...
How to just call a command and not get its output
20,773,568
3
40
60,925
0
python,subprocess
Use the /dev/null if you are using Unix. If you run any command in Shell and don't want to show its output on terminal. For example :- ls > /dev/null will not produce any output on terminal. So just use os,subprocess to execute some thing on shell and just put its o/p into /dev/null.
0
1
0
0
2011-02-14T20:22:00.000
4
0.148885
false
4,996,852
0
0
0
2
In Python, what is the shortest and the standard way of calling a command through subprocess but not bothering with its output. I tried subprocess.call however it seems to return the output. I am not bothered with that, I just need to run the program silently without the output cluttering up the screen. If it helps, I ...
Can I deploy Python .pyc files only to Google App Engine?
5,002,563
0
2
2,724
0
python,django,google-app-engine,pyc
Why would you want to do that in the first place? Because your .py files are uploaded to Google infrastructure and can be seen only if you explicitly give permissions. But yes, there is no reason as why uploading only .pyc files should not work. If you try it, in your dev environment, you will find it working just as B...
0
1
0
0
2011-02-15T10:00:00.000
3
0
false
5,002,150
0
0
1
2
I'm working on a project utilizing Django on Google App Engine. I've been asked if some of the code can be deployed as compiled only. So I guess the question is can I upload a .pyc file only that contains the piece of code in question? I've done a basic test with a views.pyc file in an application and things don't wo...
Can I deploy Python .pyc files only to Google App Engine?
5,002,914
7
2
2,724
0
python,django,google-app-engine,pyc
No, you can't - you can only upload sourcecode. There's no good reason to do this, though: your code will be bytecode-compiled on the servers when needed, and nobody is able to access your code in any case.
0
1
0
0
2011-02-15T10:00:00.000
3
1
false
5,002,150
0
0
1
2
I'm working on a project utilizing Django on Google App Engine. I've been asked if some of the code can be deployed as compiled only. So I guess the question is can I upload a .pyc file only that contains the piece of code in question? I've done a basic test with a views.pyc file in an application and things don't wo...
Problem with using system call to execute python script from MATLAB
5,007,373
0
0
2,383
0
python,matlab,numpy
The shell on your system and the shell opened by Matlab when you execute the system command are not necessarily the same. Importantly, there could be different environment variables. Try e.g. executing system('echo $PATH') to check whether you have access to all your libraries.
0
1
0
1
2011-02-15T17:01:00.000
2
0
false
5,006,837
0
0
0
1
I have a MATLAB function that needs to communicate (not rapidly, and not often) with python code. I have MATLAB write numbers to a file. Python reads the file, does some calculations, and writes some results to another file. MATLAB then reads that file and continues on its way. The problem I am having is when I want to...
Managing two instances of the same GAE application
5,012,278
1
2
74
0
python,google-app-engine
Assuming you are avoiding Nick's suggestion for some particular reason, the next best thing would be to include the copying process in your build system. 1 When you build your deploy target, maven/make/ant/"your favorite build tool" should check out copies of your latest revision from your source control system into s...
0
1
0
0
2011-02-15T23:52:00.000
3
0.066568
false
5,010,906
0
0
1
1
I have an GAE app, and I deploy it on 2 different domains, and they use separate datastores. However, right now it is done by having two identical folders with different app.yaml configurations. If I make changes I need to copy all files again. Is there an elegant solution for that, like having two app.yaml files in t...
python tornado setup
12,342,342
1
5
4,348
0
python,tornado
Use Django. I'm a hardcore Tornado fan but if you need to ask, Django is the best tool for you. Tornado is great but Django is much easier to build when you need a MySQL database thanks to its awesome ORM.
0
1
0
1
2011-02-16T00:25:00.000
5
1.2
true
5,011,135
0
0
0
4
I want to use a Python framework that handles sessions (user auth), templating along with MySQL database access (although I can use MySQLdb quite nicely) Tornado looks promising but, I just can't see how to use it. The sample given has a port listen feature. Does it replace Apache? Exactly how do I configure my server ...
python tornado setup
31,242,703
0
5
4,348
0
python,tornado
If you are using tornado follow nginx.
0
1
0
1
2011-02-16T00:25:00.000
5
0
false
5,011,135
0
0
0
4
I want to use a Python framework that handles sessions (user auth), templating along with MySQL database access (although I can use MySQLdb quite nicely) Tornado looks promising but, I just can't see how to use it. The sample given has a port listen feature. Does it replace Apache? Exactly how do I configure my server ...
python tornado setup
8,414,532
1
5
4,348
0
python,tornado
if you using tornado for websockets you can use ha-proxy for proxying socket request to tornado (ngnix not support this)
0
1
0
1
2011-02-16T00:25:00.000
5
0.039979
false
5,011,135
0
0
0
4
I want to use a Python framework that handles sessions (user auth), templating along with MySQL database access (although I can use MySQLdb quite nicely) Tornado looks promising but, I just can't see how to use it. The sample given has a port listen feature. Does it replace Apache? Exactly how do I configure my server ...
python tornado setup
7,278,376
0
5
4,348
0
python,tornado
If you setup tornado via LAMP (apache with mod_wsgi for example) you will lose every single async option in tornado, significant amount of memory and speed. It's highly recomended to use nginx for serving static files and proxying dynamic requests to the tornado application instance.
0
1
0
1
2011-02-16T00:25:00.000
5
0
false
5,011,135
0
0
0
4
I want to use a Python framework that handles sessions (user auth), templating along with MySQL database access (although I can use MySQLdb quite nicely) Tornado looks promising but, I just can't see how to use it. The sample given has a port listen feature. Does it replace Apache? Exactly how do I configure my server ...
If a command line program is unsure of stdout's encoding, what encoding should it output?
5,013,663
1
7
430
0
python,linux,shell,command-line,unicode
if your application doesn't really deal with a whole lot of internationalisation, ascii should suffice. but if not, i'd say utf-8 or better still utf-16 should be the order of the day.
0
1
0
1
2011-02-16T07:22:00.000
4
0.049958
false
5,013,599
1
0
0
2
I have a command line program written in Python, and when I pipe it through another program on the command line, sys.stdout.encoding is None. This makes sense, I suppose -- the output could be another program, or a file you're redirecting it into, or whatever, and it doesn't know what encoding is desired. But neither...
If a command line program is unsure of stdout's encoding, what encoding should it output?
5,013,662
0
7
430
0
python,linux,shell,command-line,unicode
You should output UTF-8 because thats what everyone should be using. It's a bug not to be. ;)
0
1
0
1
2011-02-16T07:22:00.000
4
0
false
5,013,599
1
0
0
2
I have a command line program written in Python, and when I pipe it through another program on the command line, sys.stdout.encoding is None. This makes sense, I suppose -- the output could be another program, or a file you're redirecting it into, or whatever, and it doesn't know what encoding is desired. But neither...
Availability of IP Address - Python
5,642,044
1
1
4,550
0
python,networking,ip-address,static-ip-address
This is so bad in so many ways I can't even explain how awfull this is. Why do you want this? Could you please tell us that, and we could come up with a much better answer than this utterly uggly "sollution"? If you have a Linux/Unix system, you can make your DHCP client to request the DHCP-server to give you a specif...
0
1
0
0
2011-02-17T02:33:00.000
3
0.066568
false
5,024,478
0
0
0
1
How to check the availability of an IP address in python? For example, I wan't to change my system's IP address to 192.168.112.226 statically overriding the dhcp provided address. The default gateway is 192.168.112.1. But I wan't to check before if anyone is using 192.168.112.226 before assigning to myself. Usually do ...
Non-blocking http server , java nio , python tornado eventlet
5,049,188
4
4
2,292
0
java,python,http,asynchronous,nonblocking
Nonblocking servers are the best choice provided all your libraries provides nonblocking apis. As mentioned in your second question if a library blocks (eg database lib making a blocking call), the entire process/thread blocks and the system hangs. Not all of the libraries available are asynchronous which makes it dif...
0
1
0
1
2011-02-17T06:31:00.000
1
0.664037
false
5,025,770
0
0
1
1
Hi I am trying to Understand if tornado/eventlet based http sever are better than threaded sever. While goggling the subject I am seeing that these are single thread event base server which run a single handler function after select/poll/epoll on socket. My first question is that is this tornado/eventlet similar to n...
Google App Engine log username with custom auth
5,035,952
0
1
252
0
python,google-app-engine,logging
Add a single logging.debug call in your authentication code to log the current user. Logs are shown aggregated by request, so you'll always be able to see the user associated with that request.
0
1
0
0
2011-02-17T09:56:00.000
1
0
false
5,027,371
0
0
1
1
I use a custom authentication for my python Google App Engine app. There is a "username" field in the log for every request, which is empty now. Is it possible to add the name of the authenticated user to the log? I would not like to add an "user: %s" % user.name manually to all of my logging.xxx statements. Thanks.
How to install scripts to sbin with python's distutils?
7,715,650
1
5
2,055
0
python,installation,distutils
For distutils, we are working on support to install scripts into prefix/sbin.
0
1
0
0
2011-02-17T11:02:00.000
2
0.099668
false
5,028,075
0
0
0
1
Commonly on most unix systems there is a distinction between $PREFIX/bin and $PREFIX/sbin. When installing a piece of software the administrator decides about what $PREFIX is, but the author decides which programs are suitable for regular users and which are not. With Python's distutils a set of scripts can be defined ...
create subprocess object from already running process
5,030,603
2
3
2,491
0
python,process,popen
Assuming you want to communicate with the "subprocess" and must do so using its standard i/o streams, you could create a wrapper around the executable that maps its stdin/out/err to a socket or named pipe. The program that intends to control the "subprocess" can then start and stop communications at any time. You may h...
0
1
0
0
2011-02-17T13:59:00.000
2
0.197375
false
5,029,880
0
0
0
2
I would like to create an subprocess.Popen object from an already running process... Is that possible somehow? Another idea would be to serialize (pickle) the subprocess object and write it to a database so that if the main process restarts it could get the subprocess.Popen objects back from the database. I'm unsure if...
create subprocess object from already running process
5,030,048
2
3
2,491
0
python,process,popen
create an subprocess.Popen object from an already running process Do you mean from an already running sub-process? The only way I know of to pass objects between processes is to pickle them and write them out either to a file or a database as you suggested. Typically, sub-processes cannot be spawned from already runnin...
0
1
0
0
2011-02-17T13:59:00.000
2
0.197375
false
5,029,880
0
0
0
2
I would like to create an subprocess.Popen object from an already running process... Is that possible somehow? Another idea would be to serialize (pickle) the subprocess object and write it to a database so that if the main process restarts it could get the subprocess.Popen objects back from the database. I'm unsure if...
Elegant Way To Share Variable Between Windows Form and Python Script Running In Background Process
5,031,228
1
3
580
0
python,winforms,global-variables
Easiest solution is probably to just have the python script print to stdout: say each time an item is processed, print a line with a number representing how many items have been processed (or a percentage). Then have the forms application read the output line by line, updating the progressbar based on that information.
0
1
0
0
2011-02-17T14:58:00.000
2
1.2
true
5,030,586
0
0
0
1
I am trying to figure out an elegant way to share a variable between a windows form app and a python script running in the background. The variable would be used solely to update a progress bar in the windows form based on the the long running process in the python script. More specifically, a windows timer will fire...
Is it possible to 'import * from DIRECTORY', then somehow (anyhow) iterate over the loaded modules?
5,054,203
4
0
210
0
python,google-app-engine,import
You can read from the filesystem in GAE just fine; you just can't write to the filesystem. from models import * will only import modules listed in __all__ in models/__init__.py; there's no automatic way to import all modules in a package if they're not declared to be part of the package. You just need to read the direc...
0
1
0
0
2011-02-19T23:24:00.000
3
1.2
true
5,054,191
0
0
1
1
Let me explain the use case... In a simple python web application framework designed for Google App Engine, I'd like to have my models loaded automatically from a 'models' directory, so all that's needed to add a model to the application is place a file user.py (for example), which contains a class called 'User', in th...
Update app engine entity
5,720,652
2
4
6,215
0
python,google-app-engine
I use GQL to query a find the Entity and if exists update de atribute. result = db.GqlQuery('select name from Person where name = "tadeu"') if result: for r in result: r.attribute = "value" r.put()
0
1
0
0
2011-02-21T13:12:00.000
4
0.099668
false
5,066,357
0
0
1
1
How to update existing record in app engine.
Pylons - how to use an old project in a new environment?
5,067,114
1
2
68
0
python,project,upgrade,pylons
might be obvious but did you run "python setup.py develop" on the application package so that the dependencies could be installed?
0
1
0
1
2011-02-21T13:28:00.000
1
0.197375
false
5,066,530
0
0
1
1
I have an old project, it written under Python 2.5/2.6, Windows. We had Python 2.6/Win7/x64 now, and I tried to start it. I got the old project that running nondebug mode in a server, and copied into local folder. When I tried to yesterday start it, I got this error: 15:44:58,038 DEBUG [pylons.configuration] Loade...