Title
stringlengths
15
150
A_Id
int64
2.98k
72.4M
Users Score
int64
-17
470
Q_Score
int64
0
5.69k
ViewCount
int64
18
4.06M
Database and SQL
int64
0
1
Tags
stringlengths
6
105
Answer
stringlengths
11
6.38k
GUI and Desktop Applications
int64
0
1
System Administration and DevOps
int64
1
1
Networking and APIs
int64
0
1
Other
int64
0
1
CreationDate
stringlengths
23
23
AnswerCount
int64
1
64
Score
float64
-1
1.2
is_accepted
bool
2 classes
Q_Id
int64
1.85k
44.1M
Python Basics and Environment
int64
0
1
Data Science and Machine Learning
int64
0
1
Web Development
int64
0
1
Available Count
int64
1
17
Question
stringlengths
41
29k
How is twisted's Deferred implemented?
10,624,853
3
2
673
0
python,asynchronous,twisted,twisted.web
As others have said, a Deferred on its own is just a promise of a value, and a list of things to do when the value arrives (or when there is a failure getting the value). How they work is like this: some function sees that the value it wants to return is not yet ready. So it prepares a Deferred, and then arranges someh...
0
1
0
0
2012-05-15T15:58:00.000
2
0.291313
false
10,604,523
0
0
1
1
Does it spawn a new thread underneath? If classical web server spawns a thread to serve a HTTP request and with Twisted web I have to spawn a Deferred() each time I want to query mysql - where's the gain? Looks like it doesn't make sens if it spawned a thread, so how's it implemented?
Thrift server facade for clients
10,649,734
0
1
314
0
python,design-patterns,thrift
Sounds like you need some sort of a mechanism to correlate requests to the different plugins available. Ideally, there should be a different URL path per set of operations published for each plugin. I would consider implementing a sort of map/dictionary of URL paths to plugins. Then for each request received, do a loo...
0
1
0
0
2012-05-16T09:53:00.000
1
0
false
10,616,104
0
0
0
1
I am having a little trouble with a server / client design and wonder if anyone had any advice. I have a Thrift server that abstracts a data store. The idea is that there will be a number of clients that are essentially out of process plugins that use the interface provided by the server to receive, manipulate the und...
Creating a KhanAcademy clone via Google App Engine - issues with application name in app.yaml
10,637,991
3
2
1,290
0
python,google-app-engine,clone
The problem is that your 'clone' application does not have access to Khans Academy's AppEngine datastore so there is no content to display. Even if you do use all of the code for their application, you are still going to have to generate all of your own content. Even if you are planning to 'clone' their content, too, y...
0
1
0
0
2012-05-17T14:27:00.000
1
0.53705
false
10,637,637
0
0
1
1
I'm trying to create a KhanAcademy (KA) clone on Google App Engine (GAE). I downloaded the offline version of KA (http://code.google.com/p/khanacademy/downloads/list) for Mac, and set it up with GoogleAppEngineLauncher (https://developers.google.com/appengine/). Because KA was produced on Python 2.5, I have the setup r...
Simulating the passing of time in unittesting
10,653,559
4
20
3,901
0
python,testing,mocking,integration-testing,celery
Without the use of a special mock library, I propose to prepare the code for being in mock-up-mode (probably by a global variable). In mock-up-mode instead of calling the normal time-function (like time.time() or whatever) you could call a mock-up time-function which returns whatever you need in your special case. I w...
0
1
0
1
2012-05-18T11:48:00.000
3
0.26052
false
10,652,097
0
0
1
1
I've built a paywalled CMS + invoicing system for a client and I need to get more stringent with my testing. I keep all my data in a Django ORM and have a bunch of Celery tasks that run at different intervals that makes sure that new invoices and invoice reminders get sent and cuts of access when users don't pay their ...
Eclipse plugin that just runs a python script
10,856,306
1
2
1,884
0
python,eclipse-plugin,eclipse-pde
You can already create an External Launch config from Run>External Tools>External Tools Configurations. You are basically calling the program from eclipse. Any output should then show up in the eclipse Console view. External launch configs can also be turned into External Builders and attached to projects. If you ar...
0
1
0
1
2012-05-19T13:55:00.000
1
1.2
true
10,665,768
0
0
1
1
I want to generate an Eclipse plugin that just runs an existing Python script with parameters. While this sounds very simple, I don't think it's easy to implement. I can generate a Eclipse plugin. My issue is not how to use PDE. But: can I call the existing Python script from Java, from an Eclipse plugin? it needs to ...
What's the best way of communication between tornado and Python based daemon?
10,667,711
0
1
732
0
python,sockets,tornado
Depending on the scale - the simple thing is to just use HTTP and the AsyncHTTPClient in Tornado. For the request<->response case in our application we're going 300 connections/second with such an approach. For the first case Fire and forget, you could also use AsyncHTTP and just have the server close out the connec...
0
1
0
1
2012-05-19T16:15:00.000
2
0
false
10,666,877
0
0
0
1
I use Tornado as the web server. I write some daemons with Python, which run in the server hardware. Sometimes the web server needs to send some data to the daemon and receives some computed results. There are two working: 1. Asynchronous mode: the server sends some data to the daemons, and it doesn't need the results ...
Including a locally developed python package in a buildout interpreter
10,678,298
0
0
143
0
python,buildout
A) The mr.developer recipe mentioned on your recipe's page is probably a better choice. B) you want your eggs in bin/python? Include them in 'eggs' in your zc.recipe.eggs part in your buildout where you generate bin/python.
0
1
0
1
2012-05-19T23:05:00.000
2
0
false
10,669,497
1
0
0
1
I'm using isotoma.buildout.autodevelop to develop eggs which I'm currently developing within my buildout. I would like to include these developed eggs (which are located on the filesystem next to my buildout.cfg) as namespaces in my buildout's custom interpreter. Can anyone provide an example of this or link to some r...
Python module for google search in GAE
10,671,099
1
0
143
0
python,google-app-engine,python-module
There is no official library for what you're trying to do, and the Google Terms of Service prohibit using automated tools to 'scrape' search results.
0
1
0
0
2012-05-20T02:26:00.000
1
1.2
true
10,670,325
0
0
1
1
I am trying to build an application in GAE using python. I needs to do is give the query received from user and give it to Google search and return the answer in a formatted way to the user. I found lots of questions asked here. But couldn't get a clear answer regarding my requirements. My needs are Needs to process la...
Eclipse + Pydev wont keep interpreter setting within the same session.
20,319,027
1
3
2,628
0
python,eclipse,installation,pydev,interpreter
I've been wresting with this problem all evening and just now solved it for me. My problem was with a workspace saved in Google Drive, but where Drive had created a lot of files with a (1) before the first period in the .metadata folder, presumably as a conflict resolution thing. Using File Commander (the search in Win...
0
1
0
1
2012-05-20T03:27:00.000
5
0.039979
false
10,670,576
0
0
0
4
I'm attempting to get eclipse running as something more powerful than a colored text editor so that I can do some Maya scripting. There's literally nothing fancy about this setup, it just doesn't keep my interpreter once the prefs window is closed. I can open and view .py docs fine, but pydev will not keep the interpr...
Eclipse + Pydev wont keep interpreter setting within the same session.
24,027,445
0
3
2,628
0
python,eclipse,installation,pydev,interpreter
I had the same problem in fedora, disappearing interpreter settings. The issue was Eclipse couldn't write to the folder even after granting read+write access. Solution: Go to terminal and type: sudo eclipse enter admin password to run as admin. Solved
0
1
0
1
2012-05-20T03:27:00.000
5
0
false
10,670,576
0
0
0
4
I'm attempting to get eclipse running as something more powerful than a colored text editor so that I can do some Maya scripting. There's literally nothing fancy about this setup, it just doesn't keep my interpreter once the prefs window is closed. I can open and view .py docs fine, but pydev will not keep the interpr...
Eclipse + Pydev wont keep interpreter setting within the same session.
27,167,729
1
3
2,628
0
python,eclipse,installation,pydev,interpreter
I had the same issue. This is how I solved it: Go to your workspace folder. Edit the file ".pydevproject". Change the path located after "PYTHON_PROJECT_INTERPRETER" pydev property. Save and you're good to go.
0
1
0
1
2012-05-20T03:27:00.000
5
0.039979
false
10,670,576
0
0
0
4
I'm attempting to get eclipse running as something more powerful than a colored text editor so that I can do some Maya scripting. There's literally nothing fancy about this setup, it just doesn't keep my interpreter once the prefs window is closed. I can open and view .py docs fine, but pydev will not keep the interpr...
Eclipse + Pydev wont keep interpreter setting within the same session.
56,161,921
1
3
2,628
0
python,eclipse,installation,pydev,interpreter
I encountered this problem, and the issue was that .project and .pydevproject were read only and Eclipse couldn't save the configurations. Solution: make .project and .pydevproject writable.
0
1
0
1
2012-05-20T03:27:00.000
5
0.039979
false
10,670,576
0
0
0
4
I'm attempting to get eclipse running as something more powerful than a colored text editor so that I can do some Maya scripting. There's literally nothing fancy about this setup, it just doesn't keep my interpreter once the prefs window is closed. I can open and view .py docs fine, but pydev will not keep the interpr...
Keep command history between (i)python sessions
10,671,869
2
3
310
0
python,shell,command-line
Exit ipython cleanly with Ctrl+D and ipython should do this by default.
0
1
0
0
2012-05-20T07:49:00.000
1
1.2
true
10,671,709
1
0
0
1
When I open a python or ipython from command-line, I don't have commands history from previous use, using up key Is there a way to configure it, to remember commands, like a .bash_history?
Save commands sent over to the gnuplot program by Gnuplot-py package
10,690,113
0
0
231
0
python,gnuplot
Non-python answer would be to use `script' command.
0
1
0
0
2012-05-21T17:32:00.000
2
0
false
10,689,818
0
0
0
1
I am new to gnuplot. I am using Unix. I see the commands/error and their output on the terminal but I want to save them on a file too for storage purposes. There is a save command in gnuplot but it only saves the last plot or splot command given by the module and the final settings. Suppose I plot a line with settings...
queues remain unknown or just don't know how to call them
10,698,246
1
1
178
0
python,google-app-engine
If your are running a unitest and using init_taskqueue_stub() you need to pass the path of the queue.yaml when calling it using the root_path parameter.
0
1
0
0
2012-05-22T07:32:00.000
1
0.197375
false
10,697,651
0
0
1
1
I've added a new queue to a python GAE app, and would like to add tasks to it, but always get an UnknownQueueError when I run my tests. On the other hand, I see the queue present in the GAE admin console (both local and remote). So the question is (1) do I miss something when I add a task to my queue? (2) if not, then ...
IPython magic commands and dashes
10,719,912
2
1
429
0
python,bash,shell,ipython
You will have to live with this. If identifiers are handled across language boundaries (in this case bash/Python) you will have problems if the languages' rules for identifiers allow different things (in this case the - is allowed in bash but not in Python). One way to solve this is name mangling. Sometimes this is d...
0
1
0
0
2012-05-22T17:47:00.000
1
1.2
true
10,707,259
1
0
0
1
I recently switched my default shell to IPython, rather than bash, by creating an IPython profile with automagic, autocall and other such features turned on. To make executables visible to the IPython environment, I've included %rehashx to run automatically in my config files. The trouble with this is that commands wit...
Eclipse Error IOError: [Errno 2] No such file or directory: 'Tarr32_Lane2_Next34_FinalAnnotations.txt'
15,859,992
2
0
2,472
0
python,eclipse
I had the same issue, but it turned out that my text file was in fact in the wrong place, even though it was in the same directory as my python script. I had to move it into the same package as the script, not just the same directory (I did this by simply dragging the text file onto the package name in the sidebar in E...
0
1
0
0
2012-05-23T21:42:00.000
2
0.197375
false
10,728,309
0
0
0
2
I keep getting this error when running this python script (that I know runs and works since I ran it in VI) within eclipse. Traceback (most recent call last): File "/home/kt/Documents/workspace/Molly's Scripts/src/ProcessingPARFuMSData.py", line 181, in annotations = open(sys.argv[1], 'r') IOError: [Errno 2] No ...
Eclipse Error IOError: [Errno 2] No such file or directory: 'Tarr32_Lane2_Next34_FinalAnnotations.txt'
10,746,692
0
0
2,472
0
python,eclipse
Seems you're launching in the wrong dir. You can configure your launch in run > run configurations.
0
1
0
0
2012-05-23T21:42:00.000
2
0
false
10,728,309
0
0
0
2
I keep getting this error when running this python script (that I know runs and works since I ran it in VI) within eclipse. Traceback (most recent call last): File "/home/kt/Documents/workspace/Molly's Scripts/src/ProcessingPARFuMSData.py", line 181, in annotations = open(sys.argv[1], 'r') IOError: [Errno 2] No ...
python enabled gdb for windows
56,772,866
1
10
8,234
0
python,gdb
In mingw installer you need to install a special package called mingw32-gdb-python. Which is the gdb compiled with python enabled
0
1
0
0
2012-05-24T07:59:00.000
2
0.099668
false
10,733,418
1
0
0
1
I am using gdb 7.4 on a windows 7 machine When I attempt to execute python script I get "Python scripting is not supported in this version of GDB" I thought that it was supported in 7.4? Where can I get a version of gdb that is python enabled for windows?
Script needs to be run as a Celery task. What consequences does this have?
10,739,006
2
0
2,052
0
python,celery
Celery implies a daemon using a broker (some data hub used to queue tasks). The celeryd daemon and the broker (RabbitMQ, redis, MongoDB or else) should always run in the background. Your tasks will be queued, this means they won't happen all at the same time. You can choose how many at the same time can be run as a ma...
0
1
0
0
2012-05-24T09:26:00.000
1
1.2
true
10,734,668
0
0
0
1
My task is it to write a script using opencv which will later run as a Celery task. What consequences does this have? What do I have to pay attention to? Is it enough in the end to include two lines of code or could it be, that I have to rewrite my whole script? I read, that Celery is a "asynchronous task queue/job que...
How do I add a path to PYTHONPATH in virtualenv
37,116,291
5
120
122,179
0
python,virtualenv
You can also try to put symlink to one of your virtualenv. eg. 1) activate your virtualenv 2) run python 3) import sys and check sys.path 4) you will find python search path there. Choose one of those (eg. site-packages) 5) go there and create symlink to your package like: ln -s path-to-your-package name-with-which-yo...
0
1
0
0
2012-05-24T13:57:00.000
6
0.16514
false
10,738,919
1
0
0
1
I am trying to add a path to the PYTHONPATH environment variable, that would be only visible from a particular virtualenv environment. I tried SET PYTHONPATH=... under a virtualenv command prompt, but that sets the variable for the whole environment. How do I achieve that?
How do I 'lock the keyboard' to prevent any more keypresses being sent on X11/Linux/Gnome?
10,769,704
2
4
5,730
0
python,linux,ubuntu,keyboard,x11
The canonical way to do this is by grabbing the input. For this no window must be actually visible. A input only window usually does the trick. However you should give the user some sort of feedback, why his input no longer works. Doing this as a focus grab has the advantage that a crash of the program won't turn the s...
0
1
0
0
2012-05-24T14:59:00.000
3
0.132549
false
10,740,067
0
0
0
1
I am writing an anti-RSI/typing break programme for Ubuntu Linux in python. I would like to be able to "lock the keyboard" so that all keypresses are ignored until I "unlock" it. I want to be able to force the user to take a typing break. I would like some programmatic way to "turn off" the keyboard (near instantaneous...
Preferred method of "deploying" python scripts to LibreOffice during macro development?
10,743,591
1
2
733
0
python,openoffice.org,libreoffice
Maybe a nice way to go is to get familiarized with Python setup tools itself (http://packages.python.org/an_example_pypi_project/setuptools.html), and write a proper setup.py script which would place all needed files in the appropriate dirs. Your macros could them even be installable with the "easy_install" Python fram...
0
1
0
1
2012-05-24T17:10:00.000
2
1.2
true
10,742,188
0
0
0
1
When developing macros in python for LibreOffice / OpenOffice on Linux at least, I've read that you have to place your py scripts in a particular directory. Is there a preferred method among Python LibreOffice/OOo developers for deploying these scripts, or is there another way to specify within LibreOffice/OOo to spe...
Access Win32 dll on Google App Engine?
10,743,291
6
0
191
0
python,winapi,google-app-engine,licensing
Nope, App Engine's python runtime only supports pure python modules. Wrapped native code modules won't work.
0
1
0
0
2012-05-24T18:21:00.000
1
1.2
true
10,743,158
0
0
1
1
BACKGROUND: I work on a small team in a large company where I'm currently revamping the licensing system for a suite of mixed .Net and Win32 products that I update annually. Each product references a win32 .dll for product validation. I only have the binary file and the header file for the licensing module (so no hash ...
Ubuntu Linux: terminal limits the output when I get the full Twitter Streaming API
10,745,449
2
1
957
0
python,linux,ubuntu,console,terminal
I'd also avoid doing this with a terminal, but to answer the question directly: right click on the terminal window profiles profile preferences scolling scollback: unlimited It's better though to redirect to a file, then access that file. "tail -f" is very helpful.
0
1
0
1
2012-05-24T21:13:00.000
3
0.132549
false
10,745,363
0
0
0
1
I have this python script that outputs the Twitter Stream to my terminal console. Now here is the interesting thing: * On snowleopard I get all the data I want. * On Ubuntu (my pc) this data is limited and older data is deleted. Both terminal consoles operate in Bash, so it has to be an OS thing presumably. My question...
python eclipse dependency plugin - m2eclipse like
10,803,047
0
0
195
0
python,eclipse,pydev
The only one so far I found available is PyFlakes, it does some level of dependency check and import validations.
0
1
0
0
2012-05-25T12:32:00.000
2
0
false
10,754,496
0
0
1
1
Is there any eclipse plugin for python dependency management? just like what M2Eclipse does for maven project? so I can resolve all the dependencies and get ride off all the errors when I develop python using pydev. If there is no such plugin, how do I resolve the dependencies, do I have to install the dependency modul...
How does `cat` work in ipython interactive shell?
10,761,540
5
5
2,575
0
python,shell,ipython,interactive
cat is one of the pre-defined system command aliases. Type %alias to see the list of aliases in your current ipython session.
0
1
0
0
2012-05-25T21:11:00.000
2
1.2
true
10,761,413
1
0
0
1
I noticed that using cat on a file works in ipython. It doesn't appear to be listed as a magic command... so I am confused how/why it works. What lets cat work in ipython interactive shell?
Execute python commands passed as strings in command line using python -c
30,690,444
55
46
42,043
0
python
You can use -c to get Python to execute a string. For example: python3 -c "print(5)" However, there doesn't seem to be a way to use escape characters (e.g. \n). So, if you need them, use a pipe from echo -e or printf instead. For example: $ printf "import sys\nprint(sys.path)" | python3
0
1
0
1
2012-05-26T18:01:00.000
2
1
false
10,768,584
0
0
0
1
Is it possible to execute python commands passed as strings using python -c? can someone give an example.
SHA 512 Password with webapp2 and App Engine?
10,780,404
2
1
827
0
python,google-app-engine,webapp2
As you observe, the default User model doesn't provide any way to customize the hash function being used. You could subclass it and redefine the problematic methods to take a hash parameter, or file a feature request with the webapp2 project. Webapp2's password hashing has much bigger issues, though, as it doesn't do p...
0
1
0
0
2012-05-27T05:55:00.000
1
1.2
true
10,771,973
0
0
1
1
If you are using webapp2 with Google App Engine you can see there is only one way to create an user with the "create_user" method [auth/models.py line:364] But that method call to "security.generate_password_hash" method where in not possible use SHA 512 Q1: I would like to know what is the best way to create a SHA 512...
PyDev for App Engine - re-import External Libs
10,773,714
0
0
149
0
python,eclipse,google-app-engine,pydev
If you create a new project, you get all the new libs. Move your existing (imported) sources to this new project.
0
1
0
0
2012-05-27T11:33:00.000
1
1.2
true
10,773,667
0
0
1
1
I have a project which I created 2 years ago. I need to work on it again, and didn't have it in my Eclipse Workspace so I downloaded it from git and did an import existing projects into workspace. All worked well, except I notice the External Libraries do not contain all the new libraries added to the SDK since I creat...
In app engine, can I call "get_or_insert" from inside a transaction?
10,791,742
2
2
308
1
python,google-app-engine
No. get_or_insert is syntactic sugar for a transactional function that fetches or inserts a record. You can implement it yourself trivially, but that will only work if the record you're operating on is in the same entity group as the rest of the entities in the current transaction, or if you have cross-group transactio...
0
1
0
0
2012-05-28T21:01:00.000
2
0.197375
false
10,790,381
0
0
1
1
In google app engine, can I call "get_or_insert" from inside a transaction? The reason I ask is because I'm not sure if there is some conflict with having this run its own transaction inside an already running transaction. Thanks!
Is there a way to make Fabric summarise results across a number of hosts?
10,807,419
2
5
391
0
python,fabric
It's just python, so you can print whatever you'd like, as well as making your own decorator to wrap the task and spit that out. As it stands though there isn't anything in core nor contrib that does that.
0
1
0
0
2012-05-29T03:30:00.000
2
0.197375
false
10,792,748
0
0
0
1
When I'm administering dozens of servers with Fabric, I often don't care about the specifics of the commands being run on each server, instead I want to collate small bits of information from each host and present it in summary at the end. Does Fabric support this functionality itself? (I've searched the documentation ...
Have user sign up with Google and get redirected back to the site afterwards?
10,818,524
1
0
688
0
python,google-app-engine
When your user goes to the login url, there is a red SIGN UP button on the top. They can go sign up there. It took me a second to find too, unfortunately you can't change the login page.
0
1
0
0
2012-05-30T11:22:00.000
2
0.099668
false
10,815,286
0
0
1
1
I am using GAE with python and I can ask users to sign in with Google using: loginURL = (users.create_login_url(self.request.path)) This gives me a link that lets users sign in and get redirected to my site. However some users do not have a Google ID, Is there any way to let them sign up for one and be redirected to my...
Python script to Batch file
10,821,382
3
3
13,915
0
python,windows,batch-file
You can't "send" a string. You can print it out and have the calling process capture it, but you can only directly return numbers from 0 through 255.
0
1
0
0
2012-05-30T17:31:00.000
5
1.2
true
10,821,300
1
0
0
2
I have a batch file that runs a python script. I am running Python 3.2. I want to send a variable like an integer or string from the python script back to the batch file, is this possible? I know I can accept command line arguments in the Python script with sys.argv. Was hoping there was some feature that allows me to ...
Python script to Batch file
10,821,423
1
3
13,915
0
python,windows,batch-file
Ignacio is dead on. The only thing you can return is your exit status. What I've done previously is have the python script (or EXE in my case) output the next batch file to be run, then you can put in whatever values you'd like and run it. The batch file that calls the python script then calls the batch file you create...
0
1
0
0
2012-05-30T17:31:00.000
5
0.039979
false
10,821,300
1
0
0
2
I have a batch file that runs a python script. I am running Python 3.2. I want to send a variable like an integer or string from the python script back to the batch file, is this possible? I know I can accept command line arguments in the Python script with sys.argv. Was hoping there was some feature that allows me to ...
Sending arguments from Batch file to Python script
69,202,173
0
10
45,693
0
python,batch-file,windows-xp
Another option is to write arguments right after the python script, following the example: python your_script.py this that If you are using Linux .sh file, remember to run dos2unix XXX.sh before you run: bash XXX.sh. The reason, in a simple version, is that dos and unix use different newline breakers.
0
1
0
1
2012-05-30T19:34:00.000
2
0
false
10,823,033
0
0
0
1
I'm running Python 3.2 on Win XP. I run a python script thru a batch file via this: C:\Python32\python.exe test.py %1 %1 is an argument that i pass to do some processing in the python script. I have 2 variables in the batch file that I also want to send as arguments to the python script. set $1=hey_hi_hello set $2=hey...
Twisted irc python bot - buffering messages
10,837,775
4
3
495
0
python,twisted,irc,bots
No. You cannot send messages instantly. Control must return to the event loop. Fortunately, the problem you're really trying to solve (inferred from comments on the question), rate limiting the messages you send, doesn't require being able to do this. Instead, stop using time.sleep in a loop and start using reactor...
0
1
0
0
2012-05-31T11:16:00.000
1
1.2
true
10,832,531
0
0
0
1
"Why does it take a long time for data I send with transport.write to arrive at the other side of the connection?" Twisted can only send data after you give up control of execution to the reactor. For example, if you have an infinite loop writing data to a transport, the data will never actually be sent since control w...
py2app installation error--Permission Denied
23,563,762
0
0
586
0
python,py2app
I had this problem for a long time. Try running it as admin.
1
1
0
0
2012-05-31T22:31:00.000
1
0
false
10,842,167
0
0
0
1
I am trying really REALLY hard to install py2app, but whenever I run the install command on the source code, I get half way through and then I get a permission denied error. Does anyone have an idea about how I could fix this? I do have admin rights on the machine I am using. I am using the admin's profile to do the in...
Easy cross-platform python way of colouring text in the command line/shell
10,861,269
1
1
844
0
python,command-line,cross-platform
You'll have to use a module if you want something cross-platform / slightly complicated. I'd recommend using pypi.python.org/pypi/colorama, which is cross-platform.
0
1
0
0
2012-06-02T09:15:00.000
3
0.066568
false
10,861,128
1
0
0
1
Bascially, I want an easy(ish), cross-platform way of colouring text in the command line/shell. I would really like this to not involve importing a module, but because cross-platform support is pretty complicated, I know it will probably have to. I don't need it to be too elaborate though, just a few basic colours will...
Shell script output to file is buffered/truncated using python multiprocessing module
11,081,096
1
2
1,403
0
python,subprocess,multiprocessing
We found out that the commands sent over ssh inside the scripts were the ones which were getting truncated in their outputs. For this we used the -n flag of ssh , which solved the problem. There is no more truncation. But this is a strange issue which happens only in python multiprocessing environment and must be consi...
0
1
0
0
2012-06-03T07:40:00.000
1
1.2
true
10,868,677
0
0
0
1
I have a python framework which has to execute bash scripts as plugins. We are using multiprocessing module to create worker processes which pick the plugin details from a multiprocessing.JoinableQueue and execute the plugins using subprocess.Popen(). It has been observed that the final output generated by the shell sc...
How to install Python interpreters on Linux in a fully automated way
10,870,525
1
4
4,193
0
python,linux,installation,build-automation,silent-installer
You can compile Python for yourself easily enough. Download and extract the Python source tarballs, then use this sequence of commands instead of the usual: $ ./configure --prefix=$HOME/local $ make $ make install You will probably want to add $HOME/local/bin to your PATH. The different minor/major versions of Pyth...
0
1
0
0
2012-06-03T12:42:00.000
4
0.049958
false
10,870,401
1
0
0
1
I'd like to have a reliable way to install Python interpreters 2.4 through to Python 3.3 on a linux user account. I am fine to presume that there is a C-compiler but i'd like to avoid relying on particular distributions or distribution versions. Is there already something maybe like a simple python script? update: i ...
performing backend operations / tasks after specific intervals of time on Google App Engine (python)
10,873,056
1
0
203
0
python,google-app-engine,scheduled-tasks,backend,task-queue
Take a look at the Cron task or set a task queue with a specific ETA
0
1
0
0
2012-06-03T19:00:00.000
2
1.2
true
10,873,049
0
0
1
1
I want my GAE app to do some back-end processing and uploading/updating results to data-store after specific intervals of time (say every 6 hours). So whenever a user uses my app (and basically requests those values from the data-store) they would get the recent/updated values from the data-store. How would this be imp...
Python interactive CLI application?
10,873,170
1
15
13,140
0
python,command-line-interface
Yes, have a look at the different curses implementations.
0
1
0
0
2012-06-03T19:14:00.000
3
0.066568
false
10,873,157
0
0
0
1
I'm not even sure what these would be called? I used to write them in ADA running on VAX-VMS! I want to make a simple menu-driven application that would let me display menus and use the cursor keys to navigate around them, choose items and navigate around the app. All fully old school text based. I want to be able to t...
GAE DataStore python - fetch() vs run()
10,874,870
2
1
576
0
python,google-app-engine,google-cloud-datastore
You can run (with run) multiple datastore queries in parallel to improve latency. This has nothing to do with your resulting HTML. The resulting HTML should be the same.
0
1
0
0
2012-06-03T22:09:00.000
2
1.2
true
10,874,312
0
0
1
2
I saw there are two methods for getting data from the datastore: fetch() and run() Regarding fetch the documentation says: Note: You should rarely need to use this method; it is almost always better to use run() instead. I don't understand the difference between the two. I am new to GAE and Python, please help me under...
GAE DataStore python - fetch() vs run()
10,883,221
3
1
576
0
python,google-app-engine,google-cloud-datastore
Beginner's advice: until you appreciate the difference, stick with fetch(). There are many other things you probably ought to get comfortable with first before this subtle distinction will bother you.
0
1
0
0
2012-06-03T22:09:00.000
2
0.291313
false
10,874,312
0
0
1
2
I saw there are two methods for getting data from the datastore: fetch() and run() Regarding fetch the documentation says: Note: You should rarely need to use this method; it is almost always better to use run() instead. I don't understand the difference between the two. I am new to GAE and Python, please help me under...
import error in eclipse, running an app as root
10,995,927
0
1
98
0
python,eclipse,import,root
It seems like your PYTHONPATH is different outside/inside Eclipse. Try just removing the Python interpreter and adding it again to gather new paths -- if that's not enough, do: import sys;print('\n'.join(sorted(sys.path))) outside/inside Eclipse to know what's different and fix your paths inside Eclipse.
0
1
0
0
2012-06-03T23:59:00.000
1
0
false
10,874,949
0
0
0
1
Im developing an installer for a GNU/Linux distribution in Python using Eclipse+PyDev. For some tasks on it there is needed that the program runs with root priviledges, but I run Eclipse as a common user. I had searched a lot of stuff on the Internet about how to run an app as root without having to run Eclipse with pr...
Loading external python modules for Pig UDFs on Amazon EMR
10,922,348
0
3
1,681
0
python,amazon,apache-pig,emr
could you manually hack sys.path inside of your jython script?
0
1
0
0
2012-06-04T17:15:00.000
1
0
false
10,885,312
0
0
1
1
I've created a python UDF to convert datetimes into different timezones. The script uses pytz which doesn't ship with python (or jython). I've tried a couple things: Bootstrapping PIG to install it's own jython and including pytz in that jython installation. I can't get PIG to use the newly installed jython, it keeps ...
QueryFrame very slow on Windows
12,700,150
1
1
565
0
python,windows,performance,opencv
I had same issue and I found out that this is caused by prolonged exposure. It may be the case that Windows drivers increased exposure to increase brightness of picture. Try to point your camera to light source or manually set decreased exposure
0
1
0
0
2012-06-04T20:23:00.000
2
0.099668
false
10,887,836
0
1
0
1
I have build a simple webcam recorder on linux which works quite well. I get ~25fps video and good audio. I am porting the recorder on windows (win7) and while it works, it is unusable. The QueryFrame function takes something more than 350ms, i.e 2.5fps. The code is in python but the problem really seems to be the lib...
TimedRotatingFileHandler: Log only when detected time to rotate
13,256,718
1
0
239
0
python
Use logging.handlers.TimedRotatingFileHandler(filename, when='H', interval=1)
0
1
0
0
2012-06-05T07:52:00.000
1
0.197375
false
10,893,554
0
0
0
1
I have a function that makes calls to a logger almost every second, however, I only want to log information an hour before the logfile rotates.
Is it possible to create an operating system using Python?
10,905,302
11
38
76,823
0
python,operating-system
I suggest you find a good textbook on operating system design, and study that. I'm pretty sure you won't find such a book with Python source code; C is more likely. (You might find an older textbook that uses Pascal instead of C, but it's really not that different.) Once you have studied operating systems design enou...
0
1
0
1
2012-06-05T20:49:00.000
4
1
false
10,904,721
1
0
0
1
Is it possible to make a minimalistic operating system using Python? I really don't want to get into low-level code like assembly, so I want to use a simple language like Perl, Python. But how?
Compiling and running code as dmg or exe
10,906,453
0
0
1,925
0
python,exe,dmg
If you mean specifically with Python, as I gather from tagging that in your question, it won't simply run the same way as Java will, because there's no equivalent Virtual Machine. If the user has a Python interpreter on their system, they they can simply run the .py file. If they do not, you can bundle the interpreter ...
0
1
0
1
2012-06-05T23:01:00.000
1
0
false
10,906,198
0
0
1
1
Newbie question I am finding it hard to get my head around. If I wanted to use one of the many tool out their like rsync lsync or s3cmd how can you build these into a program for none computer savvy people to use. Ie I am comfortable opening terminal and running s3cmd which Is developed in python how would I go about d...
Migrating GAE app from python 2.5 to 2.7
10,910,709
2
3
335
0
google-app-engine,python-2.7
Put a main file in the top-level directory and import all your handlers there, then reference them via that file
0
1
0
0
2012-06-06T08:21:00.000
2
0.197375
false
10,910,591
0
0
1
1
I am trying to migrate my app and everything worked fine until I changed in app.yaml from threadsafe: false to threadsafe: true. The error I was receiving was: threadsafe cannot be enabled with CGI handler: a/b/xyz.app After some googling I found: Only scripts in the top-level directory work as handlers, so if you hav...
Twisted Server Sent Events accessing using Internet Explorer
10,949,657
2
2
431
0
python,internet-explorer,real-time,twisted,server-sent-events
Answering my own question is a little weird. But I just found the answer. I had to go with long polling. looks like, I have to write a framework which falls-back to long polling when server sent events are not supported. Answering just in case anyone comes for reference in future.
0
1
0
0
2012-06-06T13:01:00.000
1
1.2
true
10,914,740
0
0
1
1
I am working on a project that requires real time update. So, long ago, I decided to go with using Twisted SSE Handler (cyclone.sse). The project is at an end. And all the pub/sub stuff is good on all the browsers except Internet Explorer. IE doesn't support SSE. How do I get pub-sub working on IE without change of cod...
Cron-like scheduler, something between cron and celery
10,918,986
1
3
1,859
0
python,django,cron,celery
In my personal opinion, i would learn how to use cron. This won't take more than 5 to 10 minutes, and it's an essential tool when working on a Linux server. What you could do is set up a cronjob that requests one page of your django instance every minute, and have the django script figure out what time it is and what n...
0
1
0
0
2012-06-06T17:11:00.000
2
1.2
true
10,918,905
0
0
1
1
I'd like to run periodic tasks on my django project, but I don't want all the complexity of celery/django-celery (with celerybeat) bundled in my project. I'd like, also, to store the config with the times and which command to run within my SCM. My production machine is running Ubuntu 10.04. While I could learn and use ...
As part of development, I am committing to github and pulling down and executing elsewhere. It feels wrong
10,919,450
3
1
97
0
python,github,jenkins
The solution is quite simple: make cleaner commits (fix typos before committing, only commit changes that belong together, not for too small edits). It's a bit odd that you don't take the time to fix typos (by running/testing locally) but wish to reduce the number of commits by some other means.
0
1
0
0
2012-06-06T17:40:00.000
2
0.291313
false
10,919,301
0
0
1
2
I have a standard-ish setup. Call it three servers - www, app and db, all fed from fabric scripts, and the whole on github. I have a local laptop with the repo clone. I change a file locally, and push it to github then deploy using jenkins - which pulls from github and does its business. The problem here is I can pu...
As part of development, I am committing to github and pulling down and executing elsewhere. It feels wrong
10,920,164
0
1
97
0
python,github,jenkins
The solution is to not use github / jenkins to deploy to the servers. The servers should be seen as part of the 'local' deployment (local being pre-commit) So use the fab files directly, from my laptop. That was harder because of pre processing occuring on jenkins but that is replicable. So, I shall take Jeff Atwoods a...
0
1
0
0
2012-06-06T17:40:00.000
2
1.2
true
10,919,301
0
0
1
2
I have a standard-ish setup. Call it three servers - www, app and db, all fed from fabric scripts, and the whole on github. I have a local laptop with the repo clone. I change a file locally, and push it to github then deploy using jenkins - which pulls from github and does its business. The problem here is I can pu...
How can I run my python script in the background on a schedule?
10,924,388
3
2
7,997
0
python,linux,service
The cron job is probably a good approach in general, as the shell approach requires manual intervention to start it. A couple of suggestions: You could use a lock file to ensure that the cron job only ever starts one instance of the python script - often problems occur when using cron for larger jobs because it start...
0
1
0
1
2012-06-07T00:51:00.000
2
0.291313
false
10,924,309
0
0
0
1
I have a small python script that creates a graph of data pulled from MySQL. I'm trying to figure out a way to run the script in the background all time on a regular basis. I've tried a number of things: A Cron Job that runs the script A loop timer Using the & command to run the script in the background These all hav...
Can I keep state across GAE Pipeline API workers?
10,957,940
2
3
123
0
python,google-app-engine,pipeline
There's no official way at the moment. You could probably prepend a task to the MapReduce pipeline to compute and cache the list (in the datastore or blobstore, whichever is most appropriate, plus a copy in memcache). Then have your mapper and/or reducer function do a lazy initialization of a global variable that holds...
0
1
0
0
2012-06-08T19:05:00.000
1
1.2
true
10,954,677
0
0
0
1
I've begun creating a MapReduce job with the new Google App Engine Pipeline API, and I've run into a situation where I'd like every worker to have a copy of the same list during runtime. One option would be to use memcache, but I'm worried that the size of this list might eventually be greater than what I can set with ...
Is concurrency possible in tornado?
10,962,103
10
11
5,472
0
python,concurrency,wsgi,tornado
If you are truly going to be dealing with multiple simultaneous requests that are compute-bound, and you want to do it in Python, then you need a multi-process server, not multi-threaded. CPython has Global Interpreter Lock (GIL) that prevents more than one thread from executing python bytecode at the same time. Most...
0
1
0
0
2012-06-09T15:08:00.000
2
1
false
10,962,076
1
0
0
1
I understand tornado is a single threaded and non-Blocking server, hence requests are handled sequentially (except when using event driven approach for IO operation). Is there a way to process multiple requests parallel in tornado for normal(non-IO) execution. I can't fork multiple process since I need a common memory ...
What is the Google Appengine Ndb GQL query max limit?
10,974,037
9
5
1,106
1
python,google-app-engine,gql,app-engine-ndb
This depends on lots of things like the size of the entities and the number of values that need to look up in the index, so it's best to benchmark it for your specific application. Also beware that if you find that on a sunny day it takes e.g. 10 seconds to load all your items, that probably means that some small frac...
0
1
0
0
2012-06-10T11:51:00.000
2
1
false
10,968,439
0
0
1
2
I am looking around in order to get an answer what is the max limit of results I can have from a GQL query on Ndb on Google AppEngine. I am using an implementation with cursors but it will be much faster if I retrieve them all at once.
What is the Google Appengine Ndb GQL query max limit?
10,969,575
7
5
1,106
1
python,google-app-engine,gql,app-engine-ndb
Basically you don't have the old limit of 1000 entities per query anymore, but consider using a reasonable limit, because you can hit the time out error and it's better to get them in batches so users won't wait during load time.
0
1
0
0
2012-06-10T11:51:00.000
2
1.2
true
10,968,439
0
0
1
2
I am looking around in order to get an answer what is the max limit of results I can have from a GQL query on Ndb on Google AppEngine. I am using an implementation with cursors but it will be much faster if I retrieve them all at once.
Hadoop streaming: reporting error
10,970,649
4
3
1,374
0
python,hadoop,amazon-web-services,amazon-emr
If you want to signal error, return a non-zero code from your python script. You can write any logging to stderr and hadoop will capture that in the task logs. You can also send status to the reporter and counters by prefixing the stderr lines with reporter:status:<msg> or reporter:counter:<group>,<name>,<increment>
0
1
0
0
2012-06-10T16:28:00.000
1
1.2
true
10,970,310
0
0
0
1
What is the best practice for reporting exceptions in Hadoop streaming with Python scripts? I mean: let's say I have a mapper script that can't understand its input, how do I signal Hadoop to terminate the job & report an error message? Do I use logging and finish off with sys.exit?
How to do this kind of session related task in App Engine Python?
10,973,713
1
0
42
0
python,google-app-engine,web-applications
You'd use the datastore to create a union as an entity class, with a description and a name. If your image is small you can store it in your entity, if it's large, you may store it in the blobstore and store a link to it inside your entity. You can use the python User API for authentication. You don't really need any...
0
1
0
0
2012-06-11T00:21:00.000
1
0.197375
false
10,973,432
0
0
1
1
First than all, I don't even know if this is a session related question. But I could not think a better way to describe it in the title. I'm developing a web application for registered users so they can create and manage trade unions. A user can create several unions. Each union can store an image, a description and a ...
How to make newest version of Python the default or first in path
10,979,970
1
1
109
0
python,upgrade,pythonpath,system-variable
I know you say you've updated %PATH%. However, from the description of the symptoms it is almost certain that c:\Python27 still appears on the %PATH% instead of (or before) c:\Python32. To diagnose, start cmd.exe and type set. Then locate PATH and see what Python directories it contains and in what order.
0
1
0
0
2012-06-11T12:15:00.000
2
0.099668
false
10,979,918
1
0
0
2
I have installed a new version of Python, so I want to make sure when Python is invoked that version is first in my path. So, now on my 'C' drive I have "Python27" and "Python32" (old and new version, respectively). When I type "python" in the command line I get "Python 2.7". Using control panel I have changed the "pa...
How to make newest version of Python the default or first in path
10,980,880
1
1
109
0
python,upgrade,pythonpath,system-variable
Personally, I put the dirs to all installed Python versions in %PATH%, but changed the executable names for all but the 'default' version. E.g., I have a C:\Python26\Python.exe, C:\Python27\Python27.exe and a C:\Python32\Python32.exe. This way I can easily start any version from the command line.
0
1
0
0
2012-06-11T12:15:00.000
2
0.099668
false
10,979,918
1
0
0
2
I have installed a new version of Python, so I want to make sure when Python is invoked that version is first in my path. So, now on my 'C' drive I have "Python27" and "Python32" (old and new version, respectively). When I type "python" in the command line I get "Python 2.7". Using control panel I have changed the "pa...
Rabbitmq connection issue when using a username and password
72,374,505
0
2
3,691
0
python,rabbitmq,celery
To get resolve connection with rabbitmq need to inspect below points: Connectivity from client machine to rabbitmq server machine [in case if client and server are running on separate machine], need to check along with port as well. Credential (username and password), a user must be onboarded into RabbitMQ which will ...
0
1
1
0
2012-06-13T04:47:00.000
2
0
false
11,008,337
0
0
0
1
I am trying to start some background processing through rabbitmq, but when I send the request, I get the below error in the rabbitmq log. But, I think I am providing the right credentials, as my celery works are able to connect to rabbitmq server using the same username/password combination. =ERROR REPORT==== 12-Jun-2...
Django vs webapp2 on App Engine
11,020,530
24
11
9,275
0
python,django,google-app-engine,python-2.7,webapp2
Choosing between Django and webapp2 really depends on what you're using it for. In your question you haven't given any of the parameters for your decision making, so it's impossible to tell which is "better". Describing them both as "web frameworks" shows you haven't done much research into what they are. Webapp2 is ...
0
1
0
0
2012-06-13T08:29:00.000
1
1.2
true
11,010,953
0
0
1
1
I would like to know your opinion of which of these two web frameworks (Django & webapp2) is better for using on App Engine Platform, and why? Please don't say that both are completely different, because Django is much more complete. Both are the "web frameworks" you can use in App Engine.
Run Python in cmd
30,681,229
1
10
74,076
0
python,windows-7,path,cmd,python-2.7
I hope, your problem really was the problem I think it is, because I (hopefully) had the same. I'm very sure, Levon's answer was right, so this is the n00b solution. For the CMD to recognize "python", you need to add something to the environment variable "Path". When you're done with the insturctions you can type "ech...
0
1
0
0
2012-06-13T23:49:00.000
3
0.066568
false
11,024,993
1
0
0
1
I am running python 2.7, I can run a program fine when I open the *.py file. But when I go to cmd and type "python *.py any other args", it doesn't work, it says that python is not recognised. This is hard because I am trying to do things like sys.argv[], any help is great. Thanks
Eclipse and pyddev: Error can't find Python32
11,192,462
3
2
820
0
python,eclipse
You probably still have that selected in your project or launch configuration... You can try to delete your existing launch configurations (run > run configurations) so that they get recreated on a new run and if that's not it, take a look at your project properties > pydev - interpreter/grammar and see if an old inter...
0
1
0
1
2012-06-14T13:59:00.000
1
1.2
true
11,034,733
1
0
0
1
I cannot compile python in pydev in eclipse. I get the following error: "unable to make launch because launch configuration is not valid Reason: Interpreter: Python32 not found" I am actually runnning Python26 and have configured Python26 as the interpreter in "Windows->Preferences" I have deleted and replaced my copy...
Can eclipse pydev interpret a file as a python file without a suffix
11,062,473
2
1
123
0
python,eclipse,pydev
Just right-click on the file, then hit "Open With" -> "Other", then choose "Python editor" and hit OK. Eclipse will remember your choice and from then on will open that particular file in the Python editor when you double-click it.
0
1
0
0
2012-06-15T14:48:00.000
1
1.2
true
11,052,999
1
0
0
1
If I have a python file that has no suffix. Can pydev read that file as a python file using the first line of the file if it includes a #!/usr/bin/python? I'm not really concerned specifically about using that first line, just that that line exists and might be useable. If there is a manual way to mark a file as a p...
Setting up tornado in mac
21,272,652
1
0
5,106
0
python,installation,tornado
Try running it like this: sudo easy_install tornado When you are using stock python on OSX the easy_install command will install tornado system wide and it therefore needs admin rights. When using homebrew python (e.g. installed brew and python with "brew install python") then you can install python packages without ha...
0
1
0
0
2012-06-16T17:31:00.000
2
0.099668
false
11,065,607
0
0
0
2
I'm new to using mac and tornado. I have installed easy_install and tried installing tornado but I am keep getting "Permission denied" easy_install tornado Searching for tornado Best match: tornado 2.3 Processing tornado-2.3-py2.7.egg Adding tornado 2.3 to easy-install.pth file error: /Library/Frameworks/Python.framewo...
Setting up tornado in mac
11,065,625
0
0
5,106
0
python,installation,tornado
You might want to try running that command as root if you want to install tornado system-wide or take a look at virtualenv for installing python packages in a sandboxed environment. Also, I recommend pythonbrew if you want to experiment with various versions of Python.
0
1
0
0
2012-06-16T17:31:00.000
2
0
false
11,065,607
0
0
0
2
I'm new to using mac and tornado. I have installed easy_install and tried installing tornado but I am keep getting "Permission denied" easy_install tornado Searching for tornado Best match: tornado 2.3 Processing tornado-2.3-py2.7.egg Adding tornado 2.3 to easy-install.pth file error: /Library/Frameworks/Python.framewo...
Open new python shell on C-c C-c in python-mode.el
11,602,461
2
1
1,178
0
emacs,python-mode
python-mode.el comes with a command py-execute-buffer-dedicated, opening a new and reserved process for it
1
1
0
0
2012-06-16T20:11:00.000
2
0.197375
false
11,066,684
0
0
0
1
I have a small GTK python application that imports a package (Twisted) that may not be loaded twice. If I run my application in emacs with python-mode.el and press C-c C-c, the application gets executed in a python shell window. If I now close the application, the python shell stays up and running. If I now press C-c C...
appengine DateTimeProperty auto_now=True unexpected behavior
11,094,276
2
1
327
0
python,google-app-engine
No, this is not due to the HRD -- auto_now is implemented purely in the client library. After you write the entity, the property's value does not correspond to what's written to the datastore, but to what was last read. I'm not sure what you'll see for a brand new entity but it's probably still not the same as what w...
0
1
0
0
2012-06-17T14:42:00.000
1
1.2
true
11,072,138
0
0
1
1
I use a last_touch_date DateTimeProperty as a means for revisioning entities in my application's datastore using the auto_now=True flag. When a user posts an entity it receives its last_touch_date as a reference for future updates. However, when I check the entity's last_touch_date afterwards I always find a slight del...
how to install python-rest-client lib in linux
11,184,777
1
1
1,855
0
python,json,rest
avasal, you were right. I did it by pip install python-rest-client
0
1
1
0
2012-06-18T10:45:00.000
1
1.2
true
11,081,209
0
0
0
1
I need to use python-rest-client package into my project. I tried several times for installing python-rest-client into my linux python, it never worked. But it works well in Windows python. Would anybody tell me how to install python-rest-client in linux python.
Google App Engine: Determine whether Current Request is a Taskqueue
11,082,412
7
4
923
0
python,google-app-engine,task-queue
Pick any one of the following HTTP headers: X-AppEngine-QueueName, the name of the queue (possibly default) X-AppEngine-TaskName, the name of the task, or a system-generated unique ID if no name was specified X-AppEngine-TaskRetryCount, the number of times this task has been retried; for the first attempt, this value ...
0
1
0
0
2012-06-18T11:23:00.000
2
1.2
true
11,081,767
0
0
1
1
Is there a way to dynamically determine whether the currently executing task is a standard http request or a TaskQueue? In some parts of my request handler, I make a few urlfetches. I would like the timeout delay of the url fetch to be short if the request is a standard http request and long if it is a TaskQueue.
Generating users accounts inside Google App Engine
11,093,808
3
11
4,278
0
python,google-app-engine,openid
If you don't want to require a Google Account or OpenID account you have to roll your own accounts system. This gives you maximum freedom, but it is a lot of work and makes you responsible for password security (ouch). Personally I would advise you to reconsider this requirement -- OpenID especially has a lot going for...
0
1
0
0
2012-06-18T13:19:00.000
3
0.197375
false
11,083,776
0
0
1
1
For a project, I'm going to create an application on Google App Engine where: Discussion Leaders can register with their e-mail address (or OpenID or Google Account) on the website itself to use it. In the application admin page they can create a group discussion for which they can add users based on their e-mail add...
Getting standard output from a Python Gnome Applet
11,083,956
2
0
135
0
python,applet,gnome
stdout and stderr of applications started via X or one of its children are written to ~/.xsession-errors if not redirected.
0
1
0
0
2012-06-18T13:22:00.000
1
0.379949
false
11,083,838
0
0
0
1
I'm currently writing a Gnome Panel Applet in Python. Everything is working fine as long as I don't try to actually add it to the panel (running it in a window works). When trying to add it to a panel it crashes and I have no idea why, because I can't see the error trace. Is there a simple way to log the output of a Gn...
IDLE not integrated in desktop
11,091,290
2
1
397
0
python,installation,python-idle
try making a .py file and then try to open it, and a window should appear asking you what to open it with, and then select idle in your program files.
0
1
0
0
2012-06-18T21:07:00.000
1
1.2
true
11,091,052
1
0
0
1
Just installed Python 2.7.3 on a Windows7 machine. How do I get .py files to be associated with python (they are with notepad ATM) and how do I get the context menu shortcut for "edit in IDLE"? Somehow I didn't get that on this particular computer.
How do you run the Tornado web server locally?
11,096,932
0
9
19,432
0
python,tornado
If you want to daemonize tornado - use supervisord. If you want to access tornado on address like http://mylocal.dev/ - you should look at nginx and use it like reverse proxy. And on specific port it can be binded like in Lafada's answer.
0
1
0
0
2012-06-19T05:33:00.000
4
0
false
11,094,920
0
0
0
2
Is it possible to run Tornado such that it listens to a local port (e.g. localhost:8000). I can't seem to find any documentation explaining how to do this.
How do you run the Tornado web server locally?
39,968,411
1
9
19,432
0
python,tornado
Once you've defined an application (like in the other answers) in a file (for example server.py), you simply save and run that file. python server.py
0
1
0
0
2012-06-19T05:33:00.000
4
0.049958
false
11,094,920
0
0
0
2
Is it possible to run Tornado such that it listens to a local port (e.g. localhost:8000). I can't seem to find any documentation explaining how to do this.
How to read other files in hadoop jobs?
11,098,023
0
0
91
0
python,hadoop
Problem solved by adding the file needed with the -file option or file= option in conf file.
0
1
0
0
2012-06-19T06:00:00.000
1
1.2
true
11,095,220
0
1
0
1
I need to read in a dictionary file to filter content specified in the hdfs_input, and I have uploaded it to the cluster using the put command, but I don't know how to access it in my program. I tried to access it using path on the cluster like normal files, but it gives the error information: IOError: [Errno 2] No suc...
Jenkins takes too long to execute
11,126,510
0
2
2,535
0
python,windows,selenium,build,jenkins
Check load on the machine and ensure you set Jenkins with enough memory to run those tests. It is not clear if you are working with Jenkins-slaves or directly on the master - This may also have an affect on performance.
0
1
0
1
2012-06-19T16:28:00.000
2
0
false
11,105,304
0
0
0
2
I'm currently building Python regression tests using Jenkins. For some reason, each individual test in the test suite is taking approx. 15 minutes to run (and there are about 70/80 tests total) in Jenkins, but when I run the tests from the command line on the same windows box, each individual tests takes only about 30s...
Jenkins takes too long to execute
11,109,668
1
2
2,535
0
python,windows,selenium,build,jenkins
This may have to do with running Jenkins in the background (and/or as a service). Try running it in the foreground with java -jar jenkins.war an see if it helps.
0
1
0
1
2012-06-19T16:28:00.000
2
1.2
true
11,105,304
0
0
0
2
I'm currently building Python regression tests using Jenkins. For some reason, each individual test in the test suite is taking approx. 15 minutes to run (and there are about 70/80 tests total) in Jenkins, but when I run the tests from the command line on the same windows box, each individual tests takes only about 30s...
Determine the current number of backlogged connections in TCP listen() queue
11,127,146
2
8
3,268
0
python,linux,sockets,tcp,twisted
There is no function for this in the BSD Sockets API that I have ever seen. I question whether it is really a useful measure of load. You are assuming no connection pooling by clients, for one thing, and you are also assuming that latency is entirely manifested as pending connections. But as you can't get the number an...
0
1
1
0
2012-06-20T19:00:00.000
3
0.132549
false
11,126,372
0
0
0
1
Is there a way to find out the current number of connection attempts awaiting accept() on a TCP socket on Linux? I suppose I could count the number of accepts() that succeed before hitting EWOULDBLOCK on each event loop, but I'm using a high-level library (Python/Twisted) that hides these details. Also it's using epoll...
How can I ssh into a windows box running cygwin/sshd and have the resulting terminal session use cygwin instead of default BASH?
11,140,725
1
1
865
0
python,windows,ssh,cygwin
Got it. The solution is simply to run the Cygwin.bat from the c:\cygwin folder, which puts you into a cygwin terminal, allowing the use of all of the needed functionality. The same also works for the mozilla-build terminal that I neeeded. :-D
0
1
0
0
2012-06-20T19:57:00.000
1
0.197375
false
11,127,205
0
0
0
1
I am trying to port my linux network automation to a set of Windows machines. The program I have starts with a single admin console, and transmits instructions over sockets and ssh tunnels to client machines instructing them to run specific mozmill/python scripts. I have gotten the individual client script to run on ...
top user authentication method for google app engine
11,132,393
2
1
637
0
python,google-app-engine,jinja2,authentication
Your choices are Google's own authentication, OpenID, some third party solution or roll your own. Unless you really know what you are doing, do not choose option 4! Authentication is very involved, and if you make a single mistake or omission you're opening yourself up to a lot of pain. Option 3 is not great because yo...
0
1
0
0
2012-06-21T01:32:00.000
1
1.2
true
11,130,434
0
0
1
1
Having ease of implementation a strong factor but security also an issue what would the best user authentication method for google app engine be? My goal is to have a small very specific social network. I know how to make my own but making it hack-proof is a little out of my league right now. I have looked at OpenID...
Is any other open source web server available other than Apache webserver for web application development?
11,132,477
3
0
1,701
0
python,apache,web-applications,webserver
Apart from Apache web server is there any open source web servers available for web application development? are you looking for an HTTP server or a web framework, the two are quite different. HTTP servers simply send/recieve requests among other tasks, yes you can use PHP and other tools most commonly through CGI or F...
0
1
0
0
2012-06-21T05:33:00.000
3
0.197375
false
11,132,059
0
0
1
2
Apart from Apache web server is there any open source web servers available for web application development? I am looking for a web server developing python web applications and deploy it and test it.
Is any other open source web server available other than Apache webserver for web application development?
11,132,139
0
0
1,701
0
python,apache,web-applications,webserver
If you simply Google "Open Source Web Server" you'll get a lot of results. Nginx Lighttpd Cherokee Savant Tornado Nginx is probably the best alternative.
0
1
0
0
2012-06-21T05:33:00.000
3
0
false
11,132,059
0
0
1
2
Apart from Apache web server is there any open source web servers available for web application development? I am looking for a web server developing python web applications and deploy it and test it.
Troubles with http server on linux
11,219,337
0
0
93
0
python,performance,http
It looks like that you have problems with DNS. can you check this idea running host 192.168.1.100 on the host? Please also check that other DNS queries being quickly processed. Check /etc/hosts file for a quick-and-dirty solution.
0
1
0
0
2012-06-21T16:17:00.000
2
0
false
11,142,427
0
0
1
1
I have such problem. I have local http server (BottlePy or Django), and when i use http:// localhost/ or http:// 127.0.0.1/ - it loads immediately. But when i use my local ip (192.168.1.100), it loads very long time (some minutes). What could be the problem? Server works on Ubuntu 11.
/dev/urandom range
11,147,069
4
1
1,684
0
python,linux,random,cryptography
It generates bytes, so 0x00 to 0xFF inclusive.
0
1
0
0
2012-06-21T21:29:00.000
2
1.2
true
11,147,044
1
0
0
1
I need to generate some token that can only take on a range of characters, [a-zA-Z0-9_] I'm trying to work with binascii.b2a_base64(os.urandom(64)), which has other characters such as + and are causing problems. What's the range of /dev/urandom (i'm on linux) so that I can just map the output integers to a value unifor...
Writing python on mac to use on Windows
11,161,658
4
2
6,062
0
python,windows,macos,ironpython
You can't make a native py2exe-style executable on Mac. Use Virtualbox to run Windows inside your Mac environment. No need to reboot the whole machine.
0
1
0
0
2012-06-22T17:55:00.000
2
1.2
true
11,161,613
1
0
0
1
I've seen from some sources that although you can make an exe or mac equivalent app using py2exe or py2app, you can only make the one your system is. Makes sense when I think about it. But my problem is sometimes I want to write python scripts and send them to my Windows-using friends to test and play with. But Window...
pip: inconsistent permissions issues
42,556,424
0
16
11,217
0
python,centos,pip,python-module
If executing pip with sudo, you may want sudo's -H flag -H, --set-home set HOME variable to target user's home dir e.g sudo -H pip install virtualenv
0
1
0
0
2012-06-22T18:05:00.000
2
0
false
11,161,776
1
0
0
2
When installing a package via sudo pip-python (CentOS 6 package: python-pip-0.8-1.el6.noarch), I sometimes get permission issues with the installed packages being readable only by root. Re-installing again one or two times usually fixes the problem. Has anyone experienced this? Or can anyone suggest any troubleshooting...
pip: inconsistent permissions issues
11,169,137
13
16
11,217
0
python,centos,pip,python-module
When you run a command using sudo, it will preserve the users umask. pip just installs files, it doesn't change access rights, so you'll end up with the files having the access rights set conforming to the current user's umask, which may be owner-readable only (0077) and therefore readable by root only. That means you ...
0
1
0
0
2012-06-22T18:05:00.000
2
1
false
11,161,776
1
0
0
2
When installing a package via sudo pip-python (CentOS 6 package: python-pip-0.8-1.el6.noarch), I sometimes get permission issues with the installed packages being readable only by root. Re-installing again one or two times usually fixes the problem. Has anyone experienced this? Or can anyone suggest any troubleshooting...
Fabric equivalent of try finally
11,497,518
0
5
1,088
0
python,fabric
You could always use the new execute() and wrap that in a try/except or just look at the return codes from your run()s.
0
1
0
0
2012-06-22T18:39:00.000
2
0
false
11,162,214
1
0
0
1
In the eventuality that Fabric exits cleanly or not, I need to execute a bunch of clean-up tasks (mostly delete temp files and folders). How can I achieve this with Fabric?
How can I detect my RAM free and total space in Python?
11,170,901
1
0
186
0
linux,python-2.7
You are asking for a number that is nearly impossible to calculate and has very little value. Any Linux system that is running for an amount of time will have hardly any 'free' ram available. Just cat /proc/meminfo - the MemFree entry is usually in order of just a few megabytes. So, where did that memory go? The kernel...
0
1
0
0
2012-06-22T21:55:00.000
1
0.197375
false
11,164,651
1
0
0
1
So, the title describes almost all the necessary to answer me. Just one more thing: please, just reply about libraries installed with Python by default, as the app which I'm developing is part of the Ubuntu App Showdown. Running Python 2.7, Ubuntu 12.04.
python libraries in cpanel
11,169,154
1
0
1,172
0
python,django,web-hosting,cpanel
You could try to put them in your PYTHONPATH. Usually, your current working directory is in your PYTHONPATH. If that changes, you might need to add a path to it (maybe in each file, you should check, or one common file which is always included), and put the libraries there. You can do this with import sys;sys.path.appe...
0
1
0
1
2012-06-23T10:23:00.000
2
1.2
true
11,168,747
0
0
1
2
I am using heliohost's free service to test my django apps. But Heliohost does not provide me shell access. Is there anyway to install python libraries on the host machine?
python libraries in cpanel
45,138,203
0
0
1,172
0
python,django,web-hosting,cpanel
You should inform the support of heliohost.this server has very good support that help you or install any package you want
0
1
0
1
2012-06-23T10:23:00.000
2
0
false
11,168,747
0
0
1
2
I am using heliohost's free service to test my django apps. But Heliohost does not provide me shell access. Is there anyway to install python libraries on the host machine?
Running Python Scripts from Command Line with Pypy Interpreter
11,194,517
0
0
1,249
0
python,command-line,path,pypy
to add to your path just open your start menu right click on "Computer" select "Properties" click option for "Advanced System Settings" click option for "environmental Variables" change the one named "PATH" to include the folder that you need
0
1
0
0
2012-06-25T17:37:00.000
2
0
false
11,194,380
1
0
0
1
So, I have installed the pypy pre-built interpreter to my home folder in windows; however, it only allows me to execute python scripts through the interpreters interface (similar to IDLE). I would like to extend this functionality to the cmd line in windows by putting something referencing the pypy interpreter to my sy...
Do I need to install Homebrew if I am planning to install Virtualenv?
11,214,702
2
1
680
0
python,macos,osx-lion,virtualenv,homebrew
Homebrew is just a package manager for Mac, like pip for Python. Of course you never need a package manager, you can just get all the programs, or libraries in case of pip and Pypi yourself. The point of package managers however is to ease this process and give you a simple interface to install the software, and also t...
0
1
0
0
2012-06-26T19:28:00.000
2
1.2
true
11,214,620
1
0
0
1
Being fairly new to programming, I am having trouble understanding exactly what Homebrew does... or rather - why it is needed. I know it contains pip for package management, but so does Virtualenv and I'm planning on installing this in due course. Does Homebrew install another version of python that is not the system ...