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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PHP Exec() and Python script scaleability | 12,151,910 | 0 | 4 | 266 | 0 | php,python,exec | In case of CGI, server starts a copy of PHP interpreter every time it gets a request. PHP in turn starts Python process, which is killed after exec(). There is a huge overhead on starting two processes and doing all imports on every request.
In case of FastCGI or WSGI, server keeps couple processes warmed up (min and m... | 0 | 1 | 0 | 1 | 2012-08-27T22:18:00.000 | 1 | 1.2 | true | 12,150,405 | 0 | 0 | 0 | 1 | I have a php application that executes Python scripts via exec() and cgi.
I have a number of pages that do this and while I know WSGI is the better way to go long-term, I'm wondering if for a small/medium amount of traffic this arrangement is acceptable.
I ask because a few posts mentioned that Apache has to spawn ... |
where can i find libpython2.6.dylib on osx | 23,327,147 | 0 | 1 | 2,408 | 0 | python,macos,python-2.6,dylib | On a Mac, it is stored under /usr/lib | 0 | 1 | 0 | 0 | 2012-08-28T15:49:00.000 | 1 | 0 | false | 12,162,976 | 1 | 0 | 0 | 1 | I'm looking for libpython2.6.dylib in my frameworks folder but for all my instals I can only find the libpython2.7.dylib.
I'm looking in 'System/Library/Frameworks/Python.framework/Versions/2.x'/lib .
I also notice that libpython2.7.dylib is actually just an alias for '/System/Library/Frameworks/Python.framework/Vers... |
Using BPF on a PCAP file | 13,545,284 | 1 | 1 | 993 | 0 | python,pcap,scapy | Open the pcap file with pcap_open_offline(), compile the filter "arp" with pcap_compile(), set the filter on the pcap_t * to the resulting filter with pcap_setfilter(), and then read the packets from that pcap_t *. | 0 | 1 | 0 | 0 | 2012-08-29T13:05:00.000 | 2 | 0.099668 | false | 12,178,659 | 0 | 0 | 0 | 1 | I have written a code which sniffs packets on the network. It then filters it according to the MAC address and stores it as a .pcap file. Now I want to add a function to the code which can read the .pcap file or the object that holds the sniffed packets to filter it again to get ARP packets.
I tried using PCAP library'... |
How to prevent Hudson from entering shutdown mode automatically or when idle? | 12,382,944 | 2 | 1 | 864 | 0 | continuous-integration,hudson,shutdown,python-idle | Solution: disable the thinBackup plugin
...
I figured this out by taking a look at the Hudson logs at http://localhost:8080/log/all
thinBackup was running every time the Hudson instance went into shutdown mode.
The fact that shutdown mode was occurring at periods of inactivity is also consistent with the behavior of th... | 0 | 1 | 0 | 0 | 2012-08-29T16:53:00.000 | 2 | 1.2 | true | 12,182,882 | 0 | 0 | 1 | 1 | After several months of successful and unadulterated continuous integration, my Hudson instance, running on Mac OSX 10.7.4 Lion, decides it wants to enter shutdown mode after every 20-30 minutes of inactivity.
For those of you familiar with shutdown mode, the instance of course doesn't shutdown, but has the undesirable... |
Using Numpy and SciPy on Apache Pig | 12,618,627 | 0 | 1 | 524 | 0 | python,numpy,scipy,apache-pig | You can stream through a (C)Python script that imports scipy.
I am for instance using this to cluster data inside bags, using import scipy.cluster.hierarchy | 0 | 1 | 0 | 0 | 2012-08-29T17:55:00.000 | 1 | 0 | false | 12,183,759 | 0 | 1 | 0 | 1 | I want to write UDFs in Apache Pig. I'll be using Python UDFs.
My issue is I have tons of data to analyse and need packages like NumPy and SciPy. Buy this they dont have Jython support I cant use them along with Pig.
Do we have a substitue ? |
How can I stream data, on my Mac, from a bluetooth source using R? | 12,187,989 | 0 | 0 | 377 | 0 | python,macos,r,bluetooth | there is a strong probability that you can enumerate the bluetooth as serial port for the bluetooth and use pyserial module to communicate pretty easily...
but if this device does not enumerate serially you will have a very large headache trying to do this...
see if there are any com ports that are available if there ... | 0 | 1 | 0 | 0 | 2012-08-29T23:16:00.000 | 1 | 1.2 | true | 12,187,795 | 0 | 1 | 0 | 1 | I have a device that is connected to my Mac via bluetooth. I would like to use R (or maybe Python, but R is preferred) to read the data real-time and process it. Does anyone know how I can do the data streaming using R on a Mac?
Cheers |
how to implement an on_revoked event in celery | 18,464,160 | 0 | 0 | 355 | 0 | python,celery | Use AbortableTask as a template and create a RevokableTask class to your specification. | 0 | 1 | 0 | 0 | 2012-08-30T16:00:00.000 | 1 | 0 | false | 12,200,972 | 0 | 0 | 1 | 1 | I have a task that retries often, and I would like a way for it to cleanup if it is revoked while it is in the retry state. It seems like there are a few options for doing this, and I'm wondering what the most acceptable/cleanest would be. Here's what I've thought of so far:
Custom Camera that picks up revoked tasks a... |
java- how to code a process to intercept the output streams of program running on remote machine/know when remote program has halted/completed | 12,206,913 | 1 | 0 | 142 | 0 | java,python,ruby,remote-debugging | If you're only looking to determine when it has completed (and not looking to really capture all the output, as in your other question) you can simply check for the existence of the process id and, when you fail to find the process id, phone home. You really don't need the logs for that. | 0 | 1 | 0 | 1 | 2012-08-30T23:10:00.000 | 2 | 0.099668 | false | 12,206,879 | 0 | 0 | 1 | 1 | I want to run a java program on a remote machine, and intercept its logs-- also I want to be able to know if the program has completed execution, and also whether it was successful execution or if execution was halted due to an error.
Is there any ready-made java library available for this purpose? Also, I would like t... |
How to install Django 1.4 with Python 3.2.3 in Debian? | 12,208,688 | 3 | 2 | 728 | 0 | python,django,debian | Django does not support Python 3. You will need to install a version of Python 2.x. | 0 | 1 | 0 | 0 | 2012-08-31T03:54:00.000 | 2 | 0.291313 | false | 12,208,680 | 1 | 0 | 1 | 1 | I installed Python 3.2.3 in Debian /usr/local/bin/python3 and I installed Django 1.4 in the same directory. But when I try to import django from python 3 shell interpreter I get syntax error! What am I doing wrong? |
python subprocess.popen use preexec_fn with arguments | 37,494,427 | 0 | 0 | 2,368 | 0 | python,python-2.7 | if your target function is simple enough, you may want to try anonymous functions ("lambda function"). And, you can place this lambda function as it is or, as a function object (ex)f=lambda x,y: x+y and, no need to use partial nor importing "functools" package. (btw, if you want to use only partial, you can also clean ... | 0 | 1 | 0 | 0 | 2012-08-31T04:18:00.000 | 2 | 0 | false | 12,208,839 | 1 | 0 | 0 | 1 | I have read the python document about subprocesses, but the argument preexec_fn for subprocess.Popen can only point to a function with no argument.
Now I want to call a function with two arguments just like what preexec_fn does, I've tried to use global variables, but it doesn't work.
How can I do that? |
how to switch between processes in pdb | 12,219,648 | 0 | 2 | 869 | 0 | python,pdb | It seems like it automatically gets switched at some point (probably I/O).
If you want to force it though, you should call time.sleep(). | 0 | 1 | 0 | 0 | 2012-08-31T16:26:00.000 | 2 | 0 | false | 12,219,231 | 1 | 0 | 0 | 2 | I am debugging a Python application, that makes use of os.fork() at some point.
After evaluating the function PDB remains in the parent process (as I can see from the value returned from the function).
How do I switch between child and parent process in PDB? |
how to switch between processes in pdb | 12,220,323 | 0 | 2 | 869 | 0 | python,pdb | There is no way to do that with pdb. Your best bet will be to start your pdb session (using pdb.set_trace()) inside the child process after the fork. | 0 | 1 | 0 | 0 | 2012-08-31T16:26:00.000 | 2 | 0 | false | 12,219,231 | 1 | 0 | 0 | 2 | I am debugging a Python application, that makes use of os.fork() at some point.
After evaluating the function PDB remains in the parent process (as I can see from the value returned from the function).
How do I switch between child and parent process in PDB? |
nose.run() seems to hold test files open after the first run | 12,226,647 | 0 | 0 | 193 | 0 | python,unit-testing,nose | Solved* it with some outside help. I wouldn't consider this the proper solution, but by searching through sys.modules for all of my test_modules (which point to *.pyc files) and deling them, nose finally recognizes changes again. I'll have to delete them before each nose.run() call. These must be in-memory versions of ... | 0 | 1 | 0 | 0 | 2012-09-01T05:42:00.000 | 1 | 0 | false | 12,225,244 | 0 | 0 | 0 | 1 | I'm having the same problem on Windows and Linux. I launch any of various python 2.6 shells and run nose.py() to run my test suite. It works fine. However, the second time I run it, and every time thereafter I get exactly the same output, no matter how I change code or test files. My guess is that it's holding onto fil... |
How Can I mount shared drive in Python with no root? | 12,229,835 | 3 | 0 | 813 | 0 | python,linux,share,root,drive | You can't mount without root privileges (except in some circumstances, see below.) If you have no privileges on that machine, you have to ask the administrator.
What an administrator can do is insert certain mount points into /etc/fstab and mark them user. An administrator could also install sudo for you and allow you ... | 0 | 1 | 0 | 0 | 2012-09-01T17:11:00.000 | 2 | 0.291313 | false | 12,229,752 | 0 | 0 | 0 | 1 | I am trying to mount a shared drive by using os.system() in python.
The problem is, that the installed linux version has no sudo command. Installing a sudo-package has failed.
When using the command su, I am getting an error that it must be used with suid.
I can't chmod +s because I have no root.
Any ideas? Mods? Or Bu... |
Django with Tornado | 12,256,534 | 3 | 1 | 523 | 0 | python,django,tornado | I haven't seen big projects that use tornado in front of django. But technically, you can do monkey.patch_all() with gevent. And then tornado will make sense. It's really bad solution, but if all you need is async unstable django waiting for you with chainsaw at the corner to cut your legs off instead of shooting them ... | 0 | 1 | 0 | 0 | 2012-09-01T19:25:00.000 | 2 | 1.2 | true | 12,230,701 | 0 | 0 | 1 | 2 | I see a lot of people using django with tornado using WSGIContainer. Does this make any sense? Tornado is supposed to be asynchronous, but Django is synchronous. Aren't you just shooting yourself in the foot by doing that? |
Django with Tornado | 12,254,758 | 0 | 1 | 523 | 0 | python,django,tornado | Django comes with a debug server, so i guess, using Tornado with Django, the Tornado here is the mix of Apache + mod_WSGI | 0 | 1 | 0 | 0 | 2012-09-01T19:25:00.000 | 2 | 0 | false | 12,230,701 | 0 | 0 | 1 | 2 | I see a lot of people using django with tornado using WSGIContainer. Does this make any sense? Tornado is supposed to be asynchronous, but Django is synchronous. Aren't you just shooting yourself in the foot by doing that? |
Python Parent Child Relationships in Google App Engine Datastore | 12,240,201 | 2 | 0 | 299 | 0 | python,google-app-engine,inheritance,data-modeling | What you're talking about is inheritance heirarchies, but App Engine keys provide for object heirarchies. An example of the former is "a banana is a fruit", while an example of the latter is "a car has a steering wheel". Parent properties are the wrong thing to use here; you want to use PolyModel. | 0 | 1 | 0 | 0 | 2012-09-02T03:15:00.000 | 1 | 1.2 | true | 12,233,151 | 0 | 0 | 1 | 1 | I am trying to model a parent hierarchy relationship in Google App Engine using Python. For example, I would like to model fruit.
So the root would be fruit, then a child of fruit would be vine-based, tree-based. Then for example children of tree-based would be apple, pear, banana, etc. Then as children of apple, I ... |
Will ndb work with entities that were created without using ndb on GAE? | 12,237,692 | 5 | 1 | 140 | 0 | python,google-app-engine,app-engine-ndb | ndb is simply a wrapper API. The core datastore is based on protocol buffers, and doesn't care what you use to access it. In other words, yes AFAIK it should work just fine. | 0 | 1 | 0 | 0 | 2012-09-02T16:23:00.000 | 1 | 1.2 | true | 12,237,658 | 1 | 0 | 0 | 1 | Switching to the ndb library on python GAE.
Can I use ndb with entities that were created previously using the low-level api? Or do I have to copy all the old entities and re-save them in order to use ndb?
Thanks! |
How to write a automated tool for debugging a child process through gdb | 12,267,951 | 0 | 3 | 395 | 0 | python,c,debugging,gdb,interactive | If you're running the python process interactively from a terminal, just run "gdb" normally (e.g. using os.system()) as a child of the python process. It will inherit the terminal and take over stdio just as it would if it was run from the shell. (And if you aren't running it interactively, you'll need to explain wha... | 0 | 1 | 0 | 0 | 2012-09-03T04:24:00.000 | 2 | 0 | false | 12,241,960 | 1 | 0 | 0 | 1 | I have a script in python, which spawns a new process which I want to debug in gdb. Generally I do the usual process to debug this child process. Put sleep in this process until some condition is true and then attach gdb through pid of this process in a different session, put some breakpoints and make that conditions t... |
django-celery in multiple server production environment | 12,246,221 | 6 | 5 | 1,600 | 0 | python,django,rabbitmq,celery,django-celery | It really depends on the size of the project, ideally you have RabbitMq, celery workers and web workers running on different machines.
You need only one RabbitMQ and eventually multiple queue workers (bigger queues need more workers of course).
You dont need 1 celery worker per webworker, the webworkers are going to pu... | 0 | 1 | 0 | 0 | 2012-09-03T10:23:00.000 | 1 | 1 | false | 12,245,999 | 0 | 0 | 1 | 1 | I trying to deploy a django project using django, but I have these questions unsolved:
Should I run one celeryd for each web server?
Should I run just one RabbitMQ server, on another machine (not) running celeryd there, accesible to all my web servers? or RabbitMQ must be run also on each of the web servers?
How can I... |
What does this console message mean in Google App Engine | 21,434,751 | 1 | 4 | 177 | 0 | python,google-app-engine,app-engine-ndb | This seems to happen if you have async operations in progress before you enter the ndb.toplevel function.
My guess is that this warns you that theses async operations will not be waited for at the end of the request. This could be an issue if you expected them to be included in your "toplevel" function and they are tas... | 0 | 1 | 0 | 0 | 2012-09-05T17:45:00.000 | 1 | 0.197375 | false | 12,286,987 | 0 | 0 | 1 | 1 | I'm using Google App Engine NDB with a lot of async operations and yields. The console shows me this message:
tasklets.py:119] all_pending: clear set([Future 106470190 created by
dispatch(webapp2.py:570) for tasklet post(sync.py:387); pending])
Is this a warning of some sort? Should it be ignored? It doesn't cause ... |
Is there a way to use the python subprocess module's Popen.communicate() without waiting for the process to exit? | 12,306,605 | 1 | 0 | 112 | 0 | python,io,subprocess | Check this out: http://pypi.python.org/pypi/async_subprocess/0.2.1
"Provides an asynchronous version of Popen.communicate" | 0 | 1 | 0 | 0 | 2012-09-06T17:07:00.000 | 1 | 1.2 | true | 12,305,045 | 0 | 0 | 0 | 1 | I use Windows XP and Python 2.5. I am trying to make a way for my python programs to secretly communicate with each other, I think the STARTUPOPTIONS class could hide the window, but I can't find out how I could communicate with them. On my python subprocess I tried using raw_input and on the parent I tried writing to ... |
Celery: long dedicated monolithic task vs short multiple tasks | 12,355,563 | 10 | 6 | 1,293 | 0 | python,rabbitmq,celery,distributed-computing,django-celery | There is no one-size-fits-all answer to this
Dividing a big task A into many small parts (A¹, A², A³, …) will increase potential concurrency.
So if you have 1 worker instance with 10 worker threads/processes,
A can now run in parallel using the 10 threads instead of sequentially
on one thread.
The number of parts is ... | 0 | 1 | 0 | 0 | 2012-09-06T19:38:00.000 | 1 | 1.2 | true | 12,307,173 | 0 | 0 | 0 | 1 | In my solution I use distributed tasks to monitor hardware instances for a period of time (say, 10 minutes). I have to do some stuff when:
I start this monitoring session
I finish this monitoring session
(Potentially) during the monitoring session
Is it safe to have a single task run for the whole session (10 minutes... |
What is the default installation directory with an MSI install of Python 2.7? | 12,318,294 | 5 | 2 | 3,491 | 0 | python,windows,installation-path | the default installation folder is c:/python27 | 0 | 1 | 0 | 0 | 2012-09-07T12:37:00.000 | 1 | 1.2 | true | 12,318,264 | 1 | 0 | 0 | 1 | When using windows MSI installation from python.org/download (current version is 2.7.3), python by default installs in some folder but it is nowhere documented what is this default. Can someone check that on windows?
Also does this MSI installation recognizes is it 32 or 64bit windows and installs appropriate version o... |
Putting password for fabric rsync_project() function | 12,335,299 | 2 | 1 | 1,763 | 0 | python,rsync,fabric | If rsync using ssh as a remote shell transport is an option and you can setup public key authentication for the users, that would provide you a secure way of doing the rsync without requiring passwords to be entered. | 0 | 1 | 0 | 1 | 2012-09-08T22:53:00.000 | 2 | 1.2 | true | 12,335,114 | 0 | 0 | 0 | 1 | I'd like to pass somehow user password for rsync_project() function (that is wrapper for regular rsync command) from Fabric library.
I've found the option --password-file=FILE of rsync command that requires password stored in FILE. This could somehow work but I am looking for better solution as I have (temporarily) pas... |
Eclipse Pydev: Run selected lines of code | 12,774,197 | 19 | 19 | 11,174 | 0 | python,eclipse,pydev | press CTRL+ALT+ENTER to send the selected lines to the interactive console | 0 | 1 | 0 | 1 | 2012-09-08T23:53:00.000 | 2 | 1 | false | 12,335,424 | 0 | 0 | 0 | 1 | Is there a command in Eclipse Pydev which allows me to only run a few selected (highlighted) lines of code within a larger script?
If not, is it possible to run multiple lines of code in the PyDev console at once? |
Google Appengine not signing emails with DKIM code | 12,340,517 | 1 | 0 | 441 | 0 | python,google-app-engine,dkim | How long ago did you create your DNS TXT record? Since DKIM is a DNS controlled service, and DNS often takes up to days to propagate across the Internet, you may need to wait for that to happen before Google will recognize it as valid. | 0 | 1 | 0 | 0 | 2012-09-09T15:39:00.000 | 1 | 0.197375 | false | 12,340,456 | 0 | 0 | 1 | 1 | Am confused why emails sent by my appengine app are not being signed with DKIM.
Enabled DKIM signing on Google Apps dashboard. Confirmed that my domain is "Authenticating email"
Have setup DNS TXT record using the values indicated in the apps domain. Have confirmed, using 3rd party validation tool, that the DNS is c... |
How can one load an AppEngine cloud storage backup to a local development server? | 37,780,181 | 0 | 3 | 1,341 | 0 | python,google-app-engine | For those using windows change the open line to:
raw = open('path_to_datastore_export_file', 'rb')
The file must be opened in binary mode! | 0 | 1 | 0 | 0 | 2012-09-09T15:41:00.000 | 3 | 0 | false | 12,340,468 | 0 | 0 | 1 | 1 | I'm experimenting with the Google cloud storage backup feature for an application.
After downloading the backup files using gsutil, how can they be loaded into a local development server?
Is there a parser available for these formats (eg, protocol buffers)? |
google app engine email attachment: download it to file system | 12,349,722 | 1 | 0 | 218 | 0 | python,google-app-engine,download,email-attachments | You cannot write a File to your web application directory in App Engine.
Possible choices for you are:
Save the content in the Datastore.
Use the Blobstore
Use the Google Storage facility.
Alternately, you might want to post the content away to an external server that can store the data, either your own or some 3rd p... | 0 | 1 | 0 | 0 | 2012-09-10T07:10:00.000 | 1 | 0.197375 | false | 12,346,831 | 0 | 0 | 1 | 1 | I am able to receive an email to app engine. I see the data in an attachment is payload base64 encoded data. Can I download the attachment as it is to file system without processing it or without storing it to blobstore? |
how do i pass multiple files as arguments in command line for python using regular expressions? | 12,348,372 | 1 | 0 | 1,629 | 0 | python,windows-7,command-line,tags,command-line-arguments | You cannot using standard Windows cmd shell. You can use something like bash from Cygwin, maybe PowerShell.
If you want to open *.py from application like vim but in Python, then you can use glob module. | 0 | 1 | 0 | 0 | 2012-09-10T08:56:00.000 | 2 | 1.2 | true | 12,348,291 | 1 | 0 | 0 | 1 | I'm not able to do this
ptags.py *.py
or
python *.py
i'm getting an error saying "Cannot open file named *.py"
but i'm able to open all the python files in vim using this command
vim *.py
python 2.7 in windows 7 command prompt |
Python AppEngine coding for Android app? | 12,349,313 | 0 | 0 | 130 | 0 | java,android,python,google-app-engine | The communication with your server can be totally independent of the languages used on the server and client end.
Typically web applications use principles such as REST to communicate. This is why your browser runs using HTML and JavaScript and your server can be using anything, including python.
It really depends on w... | 0 | 1 | 0 | 0 | 2012-09-10T09:44:00.000 | 1 | 1.2 | true | 12,349,086 | 0 | 0 | 1 | 1 | I'm a newbie Android Developer, and my app requires that it interacts with a server.
I came across Google AppEngine, and find it to be a good choice for this app.
If I code my Android app in Java, and do the server coding for Google AppEngine in Python, will my Android App be able to communicate with the server?
I mean... |
VIM: How to access the redo-register | 12,357,914 | 1 | 3 | 194 | 0 | python,vim,autocomplete,refactoring,rename | The . register contains the last inserted text. See :help quote_..
The help doesn't specifically mention any caveats of when this register is populated, however it does mention that it doesn't work when editing the command line. This shouldn't be an issue for you. | 0 | 1 | 0 | 0 | 2012-09-10T17:07:00.000 | 3 | 0.066568 | false | 12,356,348 | 0 | 0 | 0 | 1 | As a secondary task to a Python auto-completion (https://github.com/davidhalter/jedi), I'm writing a VIM plugin with the ability to do renaming (refactoring).
The most comfortable way to do renaming is to use cw and autocommand InsertLeave :call do_renaming_func(). To do this I need to access the redo-register (see hel... |
sqlite3 command line tools don't work in Ubuntu | 12,360,397 | 2 | 1 | 1,252 | 1 | python,linux,sqlite,ubuntu | Are you putting the DB file name in the command ?
$ sqlite3 test.db | 0 | 1 | 0 | 0 | 2012-09-10T22:23:00.000 | 1 | 1.2 | true | 12,360,279 | 0 | 0 | 0 | 1 | Trying to set up some basic data I/O scripts in python that read and write from a local sqlite db. I'd like to use the command line to verify that my scripts work as expected, but they don't pick up on any of the databases or tables I'm creating.
My first script writes some data from a dict into the table, and the seco... |
Write/Read with High Replication Datastore + NDB | 12,378,411 | 2 | 2 | 863 | 0 | google-app-engine,python-2.7,google-cloud-datastore | Pretty sure you are running into the HRD feature where queries are "eventually consistent". NDB's caching has nothing to do with this behavior. | 0 | 1 | 0 | 0 | 2012-09-11T10:41:00.000 | 2 | 1.2 | true | 12,367,904 | 0 | 0 | 1 | 1 | So I have been reading a lot of documentation on HRD and NDB lately, yet I still have some doubts regarding how NDB caches things.
Example case:
Imagine a case where a users writes data and the app needs to fetch it immediately after the write. E.g. A user creates a "Group" (similar to a Facebook/Linkedin group) and is... |
Tornado secure cookie expiration (aka secure session cookie) | 12,385,159 | 11 | 7 | 4,626 | 0 | python,cookies,tornado | It seems to me that you are really on the right track. You try lower and lower values, and the cookie has a lower and lower expiration time.
Pass expires_days=None to make it a session cookie (which expires when the browser is closed). | 0 | 1 | 0 | 0 | 2012-09-12T08:04:00.000 | 1 | 1.2 | true | 12,383,697 | 0 | 0 | 1 | 1 | How can I set in Tornado a secure cookie that expires when the browser is closed?
If I use set_cookie I can do this without passing extra arguments (I just set the cookie), but how if I have to use set_secure_cookie?
I tried almost everything:
passing nothing: expiration is set to its default value, that is 1 month ... |
Serving many on-the-fly generated images with Django | 12,390,045 | 0 | 4 | 676 | 0 | python,django,apache,comet,wsgi | If one user is all you need to bring your webserver down then the problem is not apache or mod_wsgi.
First you should optimize your tiling routines and check if you really only deliver the data a user actually sees.
After that a faster cpu, more ram, a ssd and aggressive caching will give you more performance.
At last ... | 0 | 1 | 0 | 0 | 2012-09-12T11:59:00.000 | 3 | 0 | false | 12,387,707 | 0 | 0 | 1 | 2 | Similar to a tiling server for spatial image data, I want to view many on-the-fly generated images in my Django based web application (merge images, color change, etc.). Since one client can easily request many (>100) images in a short time, it is easy to bring the web server (Apache + mod_wsgi) down.
Hence, I am looki... |
Serving many on-the-fly generated images with Django | 12,390,401 | 1 | 4 | 676 | 0 | python,django,apache,comet,wsgi | All this works fine when the tiles are statically served. Now I added
the option to generate those tiles on the fly -- different images are
merged, color corrected, …. This works, but is some heavy load for the
web server as one image takes about 0.1s to be generated.
You need a load balancer, with image request... | 0 | 1 | 0 | 0 | 2012-09-12T11:59:00.000 | 3 | 0.066568 | false | 12,387,707 | 0 | 0 | 1 | 2 | Similar to a tiling server for spatial image data, I want to view many on-the-fly generated images in my Django based web application (merge images, color change, etc.). Since one client can easily request many (>100) images in a short time, it is easy to bring the web server (Apache + mod_wsgi) down.
Hence, I am looki... |
Python 3.2.3, easy_install, Mac OS X | 18,519,381 | 0 | 2 | 5,950 | 0 | python,macos,python-3.x,easy-install | For what its worth on my install of python3 (using homebrew), calling the correct binary was all that was required. easy_install3 was already on the system path, as was easy_install-3.3. | 0 | 1 | 0 | 0 | 2012-09-12T16:34:00.000 | 2 | 0 | false | 12,392,699 | 0 | 0 | 0 | 1 | I am a windows 7 user, so pardon me for my ignorance. I have been trying to help my friend get easy_install working on her Mac OS X laptop. We managed to get everything working for 2.7 with these commands in the terminal:
python distribute_setup.py (which installs "distribute")
easy_install
We tried the same thing fo... |
Errno 32 Broken pipe, Errno 107 Transport endpoint is not connected python socket | 12,423,190 | 0 | 0 | 2,488 | 0 | python,apache,tcp,broken-pipe,sigpipe | I had to set apache settings to following:
KeepAlive On
MaxKeepAliveRequests 0
KeepAliveTimeout 5
I will further investigate the problem and see if this is proper solution. | 0 | 1 | 0 | 0 | 2012-09-13T13:56:00.000 | 1 | 1.2 | true | 12,407,939 | 0 | 0 | 0 | 1 | My TCP Server is written in Qt 4.7, works well with TCP Client also written in Qt 4.7.
I am trying to connect and communicate with Server with client written in python 2.7.3. I start the Server process via apache http request with subprocess.call(path_to_server). I am using mod_wsgi 3.3 and django 1.4.
Connection is es... |
Changing the default python in OSX Mountain Lion | 12,421,681 | 2 | 4 | 4,810 | 0 | python,macos,macports,osx-mountain-lion | The sudo port select command only switches what /usr/local/bin/python points to, and does not touch the /usr/bin/python path at all.
The /usr/bin/python executable is still the default Apple install. Your $PATH variable may still look in /usr/local/bin before /usr/bin though when you type in python at your Terminal pro... | 0 | 1 | 0 | 0 | 2012-09-14T09:20:00.000 | 2 | 1.2 | true | 12,421,574 | 0 | 0 | 0 | 1 | I installed Python through MacPorts, and then changed the path to that one.
/opt/local/bin/python
using this command
sudo port select python python27
But now i want to revert to the Mac one at this path
/usr/bin/python
How can I go about doing this?
EDIT:
I uninstalled the MacPort Python, restarted the terminal and ev... |
development environment for python projects | 12,425,441 | 0 | 0 | 210 | 0 | python,ide,text-editor | Komodo is a good commercial IDE.And Eric is a free python IDE which is written with python. | 0 | 1 | 0 | 1 | 2012-09-14T13:17:00.000 | 4 | 0 | false | 12,425,407 | 1 | 0 | 0 | 1 | I am running python on linux and am currently using vim for my single-file programs, and gedit for multi-file programs. I have seen development environments like eclipse and was basically wondering if there's a similar thing on ubuntu designed for python. |
Usage of pypy compiler | 12,432,095 | 2 | 8 | 7,679 | 0 | python,python-3.x,python-2.7,pypy | pypy is a compliant alternative implementation of the python language. This means that there are few (intentional) differences. One of the few differences is pypy does not use reference counting. This means, for instance, you have to manually close your files, they will not be automatically closed when your file variab... | 0 | 1 | 0 | 0 | 2012-09-14T20:55:00.000 | 2 | 0.197375 | false | 12,431,847 | 1 | 0 | 0 | 1 | Is there a difference in python programming while using just python and while using pypy compiler? I wanted to try using pypy so that my program execution time becomes faster. Does all the syntax that work in python works in pypy too? If there is no difference, can you tell me how can i install pypy on debian lunux and... |
How many bytes are received with dataReceived? | 12,433,363 | 3 | 2 | 296 | 0 | python,twisted | In Python 2,
str → a sequence of bytes, which is sometimes used as ASCII text
bytes → an alias for str (available in python 2.6 and later)
unicode → a sequence of unicode code units (UCS-2 or UCS-4, depending on compile time options, UCS-2 by default)
In Python 3,
str → a sequence of unicode code units (UCS-4)
bytes... | 0 | 1 | 0 | 0 | 2012-09-14T20:58:00.000 | 2 | 1.2 | true | 12,431,871 | 1 | 0 | 0 | 2 | I am using Twisted to receive data from a socket.
My protocol class inherits from Protocol.
As there are no byte type in Python 2.*, the type of received data is str.
Of course, len (data) gives me the length of the string but how can I know
the number of bytes received ? There is not sizeof or something equivalent tha... |
How many bytes are received with dataReceived? | 12,431,966 | 4 | 2 | 296 | 0 | python,twisted | The length of the string is the length in bytes. | 0 | 1 | 0 | 0 | 2012-09-14T20:58:00.000 | 2 | 0.379949 | false | 12,431,871 | 1 | 0 | 0 | 2 | I am using Twisted to receive data from a socket.
My protocol class inherits from Protocol.
As there are no byte type in Python 2.*, the type of received data is str.
Of course, len (data) gives me the length of the string but how can I know
the number of bytes received ? There is not sizeof or something equivalent tha... |
Design recommendations for a multi-user web based count down timer | 12,462,388 | 0 | 1 | 414 | 0 | java,python,web-applications,timer,clock | Single master clock that is always running (no users need be logged in for clock to continue running)
That's not hard.
The variance between what any given viewer sees and the actual time on the master clock can not be greater than 1 second.
That's pretty much impossible. You can take into account network delays and... | 0 | 1 | 0 | 0 | 2012-09-17T14:44:00.000 | 2 | 0 | false | 12,461,724 | 0 | 0 | 1 | 1 | I help with streaming video production on a weekly basis. We stream live video to a number of satellite locations in the Dallas area. In order to ensure that all of the receiving locations are on the same schedule as the broadcasting location we use a desktop clock/timer application and the remote locations VNC into th... |
How do I notify Python/Tornado that the client has closed the tab/browser? | 12,549,017 | 0 | 4 | 1,509 | 0 | python,connection,chat,tornado | I've been having this issue for like 5 - 6 days and finally found out what the problem is, well.. not exactly actually but it's solved! I've been searching on the internet but found nothing. I told in the above post that I do remember it working when I tried the same script a couple months ago, but I never mentioned us... | 0 | 1 | 0 | 0 | 2012-09-17T21:15:00.000 | 2 | 1.2 | true | 12,467,204 | 0 | 0 | 0 | 1 | I've been searching for quite a while for a solution about this but no dice.
Edit: I didn't point out that I'm trying to make a chat server. So people log in, their id gets appended to a users and a listeners list. And they start chatting. But when one of them tries to close the tab or browser the user will never be de... |
install OSQA using xampp on windows 7 | 13,022,630 | 1 | 0 | 201 | 0 | python,xampp,osqa | If you're flexible about xampp, try bitnami native installer:
http://bitnami.org/stack/osqa
It took me about 10min for the installer to run, then I had running on Win7 localhost. | 0 | 1 | 0 | 0 | 2012-09-18T07:38:00.000 | 1 | 1.2 | true | 12,472,432 | 0 | 0 | 0 | 1 | can anyone tell me that how can i install osqa on windows 7 with xampp localhost ? i don't know xampp support python.
Thanks in advance. |
Game Engine 3D to Python3.x? | 31,010,631 | 1 | 2 | 1,505 | 0 | python,python-3.x,game-engine | If you want a game engine in python, I would recommend these:
Kivy (multiplatform)
PyGame (multiplatform)
Blender (graphical game engine made in python, multiplatform, also used for modeling)
PyOpenGL (multiplatform, 3d game engine like blender)
These are some game engines I know. You also might want to try Unity3d. | 0 | 1 | 0 | 1 | 2012-09-19T02:46:00.000 | 2 | 0.099668 | false | 12,487,889 | 0 | 0 | 0 | 2 | What its the best game-engine 3D to Python 3.x and easy to install on Linux (Debian 7 "wheezy")? |
Game Engine 3D to Python3.x? | 12,488,430 | 2 | 2 | 1,505 | 0 | python,python-3.x,game-engine | Not sure if it is the "best" - but not working on the field I am aware of few others than Blender 3D 's game engine. Blender moved to Python 3 scripting at version 2.5, so any newer version than that will use Python 3 for BGE (Blender Game Engine) scripts.
Pygame is also available for Python 3.x, and it does feature a... | 0 | 1 | 0 | 1 | 2012-09-19T02:46:00.000 | 2 | 0.197375 | false | 12,487,889 | 0 | 0 | 0 | 2 | What its the best game-engine 3D to Python 3.x and easy to install on Linux (Debian 7 "wheezy")? |
How to support both argparse and optparse? | 12,491,541 | 3 | 4 | 394 | 0 | python,argparse,optparse | I would stick with optparse as long as it provides the functionality you currently need (and expect to need in future).
optparse works perfectly fine, it just won't be developed further. It's still available in Python 3, so even if one day you decide to move to Python 3, it will continue to work. | 0 | 1 | 0 | 0 | 2012-09-19T08:57:00.000 | 2 | 1.2 | true | 12,491,429 | 1 | 0 | 0 | 1 | I have a small application that runs on fairly recent Linux distributions with Python 2.7+ but also on CentOS and Scientific Linux boxes that have not yet made the switch to Python 2.7. optparse is deprecated with Python 2.7 and frankly I don't want to support optparse anyway, which is why I developed the application w... |
Multiple lines user input in command-line Python application | 12,494,019 | 0 | 6 | 6,926 | 0 | python,string,input,copy-paste | Use :
input = raw_input("Enter text")
These gets in input as a string all the input. So if you paste a whole text, all of it will be in the input variable.
EDIT: Apparently, this works only with Python Shell on Windows. | 0 | 1 | 0 | 0 | 2012-09-19T11:37:00.000 | 3 | 0 | false | 12,493,934 | 1 | 0 | 0 | 1 | Is there any easy way to handle multiple lines user input in command-line Python application?
I was looking for an answer without any result, because I don't want to:
read data from a file (I know, it's the easiest way);
create any GUI (let's stay with just a command line, OK?);
load text line by line (it should paste... |
easy_install2.5 fails to install python-ldap on Ubuntu 12.04 | 12,494,482 | 1 | 0 | 1,640 | 0 | python,ubuntu | It looks like you need the python 2.5 header files. You might be able to find them in synaptic under python2.5-dev or something similar. | 0 | 1 | 0 | 0 | 2012-09-19T12:12:00.000 | 1 | 1.2 | true | 12,494,465 | 0 | 0 | 0 | 1 | easy_install-2.5 python-ldap
Searching for python-ldap
Reading http://pypi.python.org/simple/python-ldap/
Reading http://www.python-ldap.org/
Best match: python-ldap 2.4.10
Downloading http://pypi.python.org/packages/source/p/python-ldap/python-ldap-2.4.10.tar.gz#md5=a15827ca13c90e9101e5e9405c1d83be
Processing python-l... |
Python Error The _posixsubprocess module is not being used | 12,508,287 | 3 | 7 | 12,868 | 0 | python,multithreading | check if you can import _posixsubprocess manually, subprocess tries to import this in it's code, if it produces an exception this warning is produced. | 0 | 1 | 0 | 0 | 2012-09-20T07:53:00.000 | 5 | 0.119427 | false | 12,508,243 | 1 | 0 | 0 | 3 | Hi im running a subprocess with threads trough a python wrapper and I get the following warning when I use the subprocess module.
"The _posixsubprocess module is not being used, Child process reliability may suffer if your program uses threads."
What dose this mean?
How can I get rid of it? |
Python Error The _posixsubprocess module is not being used | 51,902,409 | 3 | 7 | 12,868 | 0 | python,multithreading | unsetting PYTHONHOME has fixed this issue for me. | 0 | 1 | 0 | 0 | 2012-09-20T07:53:00.000 | 5 | 0.119427 | false | 12,508,243 | 1 | 0 | 0 | 3 | Hi im running a subprocess with threads trough a python wrapper and I get the following warning when I use the subprocess module.
"The _posixsubprocess module is not being used, Child process reliability may suffer if your program uses threads."
What dose this mean?
How can I get rid of it? |
Python Error The _posixsubprocess module is not being used | 62,709,088 | 0 | 7 | 12,868 | 0 | python,multithreading | It could be if you have more than a version of Python in use.
you need to specify the correct version of python to use for each programme.
For example, I need python 3.7 for miniconda, but mendeleydesktop claims for trouble with this version:
also problem with _posixsubproces and its location
so instead of run the prog... | 0 | 1 | 0 | 0 | 2012-09-20T07:53:00.000 | 5 | 0 | false | 12,508,243 | 1 | 0 | 0 | 3 | Hi im running a subprocess with threads trough a python wrapper and I get the following warning when I use the subprocess module.
"The _posixsubprocess module is not being used, Child process reliability may suffer if your program uses threads."
What dose this mean?
How can I get rid of it? |
Python app which reads and writes into its current working directory as a .app/exe | 12,520,441 | 0 | 2 | 1,641 | 0 | python,file,io,exe,.app | Use the __file__ variable. This will give you the filename of your module. Using the functions in os.path you can determine the full path of the parent directory of your module. The os.path module is in the standard python documentation, you should be able to find that.
Then you can combine the module path with your f... | 0 | 1 | 0 | 0 | 2012-09-20T19:29:00.000 | 2 | 0 | false | 12,519,610 | 1 | 0 | 0 | 1 | I have a python script which reads a text file in it's current working directory called "data.txt" then converts the data inside of it into a json format for another separate program to handle.
The problem i'm having is that i'm not sure how to read the .txt file (and write a new one) which is in the same directory as ... |
How to fetch time-based entity from datastore in app engine | 12,522,188 | 2 | 1 | 391 | 0 | python,google-app-engine,app-engine-ndb | You could add another field for the date. A ComputedProperty would probably make sense for that.
Or you could fetch from the start of the day, in batches, and stop fetching once you reach the end of your day. I'd imagine you could come up with a sensible default based on how many appointments you'd typically have in on... | 0 | 1 | 0 | 0 | 2012-09-20T23:03:00.000 | 3 | 1.2 | true | 12,522,160 | 0 | 0 | 1 | 2 | I have an application on app engine, and this application has an entity called Appointment. An Appointment has a start_time and a end_time. I want to fetch appointments based on the time, so I want to get all appointments for a given day, for example.
Since app engine doesn't support inequality query based on two fiel... |
How to fetch time-based entity from datastore in app engine | 12,535,660 | 1 | 1 | 391 | 0 | python,google-app-engine,app-engine-ndb | The biggest problem is that a "date" means a different start and end "time" depending on a time zone of a user. And you cannot force all of your users to stick to one time zone all of the lives, not to mention DST changes twice a year. So you cannot simply create a new property in your entity to store a "date" object a... | 0 | 1 | 0 | 0 | 2012-09-20T23:03:00.000 | 3 | 0.066568 | false | 12,522,160 | 0 | 0 | 1 | 2 | I have an application on app engine, and this application has an entity called Appointment. An Appointment has a start_time and a end_time. I want to fetch appointments based on the time, so I want to get all appointments for a given day, for example.
Since app engine doesn't support inequality query based on two fiel... |
Import Error: No module named pytz after using easy_install | 14,970,445 | 3 | 6 | 21,691 | 0 | python,python-2.7 | For what it's worth, the answer to the fundamental problem here is that the pytz installation process didn't actually extract the ".egg" file (at least, this is what I noticed with a very similar issue.)
You may consider going into the site-packages folder and extracting it yourself. | 0 | 1 | 0 | 0 | 2012-09-22T03:28:00.000 | 3 | 0.197375 | false | 12,540,435 | 1 | 0 | 0 | 2 | Today is my first day at Python and have been going through problems. One that I was working on was, "Write a short program which extracts the current date and time from the operating system and prints it on screen in the following format: day, month, year, current time in GMT.
Demonstrate that it works."
I was going ... |
Import Error: No module named pytz after using easy_install | 27,397,683 | 3 | 6 | 21,691 | 0 | python,python-2.7 | It is important if you are using python v2 or python v3 - it has separate easy_install package!
In debian there are:
python-pip
python3-pip
and then
easy_install
easy_install3
If you use wrong version of easy_install you will be updating wrong libraries. | 0 | 1 | 0 | 0 | 2012-09-22T03:28:00.000 | 3 | 0.197375 | false | 12,540,435 | 1 | 0 | 0 | 2 | Today is my first day at Python and have been going through problems. One that I was working on was, "Write a short program which extracts the current date and time from the operating system and prints it on screen in the following format: day, month, year, current time in GMT.
Demonstrate that it works."
I was going ... |
hadoop streaming with python modules | 12,556,901 | 0 | 0 | 1,087 | 0 | python,hadoop,hadoop-streaming | After reviewing sent_tokenize's source code, it looks like the nltk.sent_tokenize AND the nltk.tokenize.sent_tokenize methods/functions rely on a pickle file (one used to do punkt tokenization) to operate.
Since this is Hadoop-streaming, you'd have to figure out where/how to place that pickle file into the zip'd code ... | 0 | 1 | 0 | 0 | 2012-09-23T13:51:00.000 | 1 | 1.2 | true | 12,552,890 | 0 | 0 | 0 | 1 | I've seen a technique (on stackoverflow) for executing a hadoop streaming job using zip files to store referenced python modules.
I'm having some errors during the mapping phase of my job's execution. I'm fairly certain it's related to the zip'd module loading.
To debug the script, I have run my data set through sys.st... |
Celery Task Grouping/Aggregation | 12,705,857 | 4 | 13 | 3,185 | 0 | python,asynchronous,task,celery,aggregation | An easy way to accomplish this is to write all the actions a task should take on a persistent storage (eg. database) and let a periodic job do the actual process in one batch (with a single connection).
Note: make sure you have some locking in place to prevent the queue from being processes twice!
There is a nice examp... | 0 | 1 | 0 | 0 | 2012-09-23T21:14:00.000 | 2 | 0.379949 | false | 12,556,309 | 0 | 0 | 1 | 1 | I'm planning to use Celery to handle sending push notifications and emails triggered by events from my primary server.
These tasks require opening a connection to an external server (GCM, APS, email server, etc). They can be processed one at a time, or handled in bulk with a single connection for much better performanc... |
Options for Image Caching | 12,585,067 | 1 | 0 | 717 | 0 | python,google-app-engine,caching,distributed-caching,image-caching | Blobstore is fine.
Just make sure you set the HTTP cache headers in your url handler. This allows your files to be either cached by the browser (in which case you pay nothing) or App Engine's Edge Cache, where you'll pay for bandwidth but not blobstore accesses.
Be very careful with edge caching though. If you set an... | 0 | 1 | 0 | 0 | 2012-09-24T22:40:00.000 | 3 | 0.066568 | false | 12,573,915 | 0 | 0 | 1 | 1 | I am running a website on google app engine written in python with jinja2. I have gotten memcached to work for most of my content from the database and I am fuzzy on how I can increase the efficiency of images served from the blobstore. I don't think it will be much different on GAE than any other framework but I wan... |
why is monkeyrunner not working when run from a remote machine? | 12,593,620 | 0 | 2 | 1,078 | 0 | android,python,centos,monkeyrunner,rpyc | Using this function to run monekyrunner doesn't work although running ls, pwd works fine.
conn.modules.subprocess.Popen("/opt/android-sdk/tools/monkeyrunner -v
ALL
/opt/android-sdk/tools/MYSCRIPT.py", shell=True)
The chunk of code below solved my problem :
import rpyc
import subprocess , os
conn = rpyc.classic.... | 0 | 1 | 0 | 1 | 2012-09-25T07:20:00.000 | 2 | 0 | false | 12,578,021 | 0 | 0 | 0 | 1 | I need to run a monkeyrunner script in a remote machine. I'm using python to to automate it and RPyC so that I could connect to other machines, everything is running in CentOS.
written below is the command that I used:
import rpyc
import subprocess
conn = rpyc.classic.connect("192.XXX.XXX.XXX",XXXXX)
conn.execute ("pr... |
How to put a PC into sleep mode using python? | 12,581,615 | 0 | 2 | 1,160 | 0 | python | If you have "Wake On Lan" enabled you could potentially run a python script on a different PC and trigger the wake up after your specific period of time.
The scripts would probably need to talk to each other, unless you just do it all at times set in advance. | 0 | 1 | 0 | 0 | 2012-09-25T10:51:00.000 | 2 | 0 | false | 12,581,463 | 1 | 0 | 0 | 1 | While the copy is in progress, can we put a PC into sleep mode for a specific period of time, then wake up and continue copy using python script? Can you please share the code?
Actually this is possible using shell script. |
Scripting Hashbang: How to get the python 2 interpreter? | 12,606,395 | 0 | 3 | 739 | 0 | python,linux,shell,unix,python-2.7 | If you must run on python 2, you best also call the interpreter as python2. I think most UNIX releases have symlinks from /usr/bin/python/and /usr/bin/python2 to the appropriate binary. | 0 | 1 | 0 | 0 | 2012-09-26T16:31:00.000 | 3 | 0 | false | 12,606,333 | 0 | 0 | 0 | 1 | I'm writing scripts that have to run on a number of different UNIX-like releases.
These are written in python 2.x.
Unfortunately, some newer releases have taken to calling this flavor binary "python2" instead of "python." Thus, "#!/usr/bin/env python" doesn't work to look for the proper installed python interpreter. Ei... |
How to automate the sending of files over the network using python? | 12,613,729 | 0 | 0 | 1,825 | 0 | python,shell,terminal,centos | per my experience, use sftp the first time will prompt user to accept host public key, such as
The authenticity of host 'xxxx' can't be established.
RSA key fingerprint is xxxx. Are you sure you want to continue connecting
(yes/no)?
once you input yes, the public key will be saved in ~/.ssh/known_hosts, and next t... | 0 | 1 | 1 | 0 | 2012-09-27T03:14:00.000 | 3 | 0 | false | 12,613,552 | 0 | 0 | 0 | 1 | Here's what I need to do:
I need to copy files over the network. The files to be copied is in the one machine and I need to send it to the remote machines. It should be automated and it should be made using python. I am quite familiar with os.popen and subprocess.Popen of python. I could use this to copy the files, BUT... |
Python libraries after removing MacPorts and installing homebrew | 12,623,496 | 3 | 1 | 215 | 0 | python,macports,homebrew | I wouldn't use the Macports packages in Homebrew. I'd reinstall them all. A lot of Python packages are compiled , or at least have compiled elements. You're asking for a lot of potential troubles mixing them up. | 0 | 1 | 0 | 0 | 2012-09-27T13:59:00.000 | 1 | 1.2 | true | 12,623,155 | 1 | 0 | 0 | 1 | I recently removed Macports and all its packages and installed Python, Gphoto and some other bits using Homebrew. However python is crashing when looking for libraries as it is looking for them in a MacPorts path. My PATH is correct and the python config show the right path /usr/local/Cellar etc.
Can someone tell me h... |
python terminate/kill subprocess group | 12,680,641 | 3 | 3 | 1,294 | 0 | python,subprocess,popen,kill,kill-process | By changing the gid at the beginning of the execution of script2.py, the sub sequent processes belongs to script2 gid. So calling killpg() from script1.py with script2's pid does it well. | 0 | 1 | 0 | 0 | 2012-09-27T16:28:00.000 | 2 | 1.2 | true | 12,625,951 | 0 | 0 | 0 | 1 | I have a few python scripts who are opening themselves in cascade by subprocess.Popen().
(I call script1.py who make a popen of script2.py who makes popen of script3.py, etc)
Is there any way to terminate/kill all subprocesses of script1.py from the script1.py PID.
os.killpg() doesn't work.
Thanks for your help. |
Which one is the faster way to get the list of directories subprocess.Popen or os.listdir | 12,629,604 | 3 | 0 | 692 | 0 | python,python-2.7 | os.listdir is very likely to be compiled c that calls the same base libc system methods that ls does.
In contrast, subprocess.Popen forks a whole new process which is an expensive system operation and requires new file handles to deal with tty operations. | 0 | 1 | 0 | 0 | 2012-09-27T19:55:00.000 | 1 | 0.53705 | false | 12,629,091 | 0 | 0 | 0 | 1 | I want to retrieve the list of files in a directory. What would be the fastest way to do so
using subprocess.Popen or using os.listdir. The directory contain 10000 of files. and this has to be done recursively to retrieve the list from the directory and its sub directories. I know we can use os.walk to retrieve the co... |
Optimizing the size of embedded Python interpreter | 12,632,227 | 3 | 17 | 8,769 | 0 | python,embedded | There may be ways you can cram it down a little more just by configuring, but not much more.
Also, the actual interactive-mode code is pretty trivial, so I doubt you're going to save much there.
I'm sure there are more substantial features you're not using that you could hack out of the interpreter to get the size down... | 0 | 1 | 0 | 1 | 2012-09-27T23:32:00.000 | 3 | 0.197375 | false | 12,631,577 | 0 | 0 | 0 | 1 | I spent the last 3 hours trying to find out if it possible to disable or to build Python without the interactive mode or how can I get the size of the python executable smaller for linux.
As you can guess it's for an embedded device and after the cross compilation Python is approximately 1MB big and that is too much ... |
Python CGI in IIS: issue with urandom function | 21,917,122 | 0 | 5 | 928 | 0 | python,cgi,iis-7.5 | I've solved the _urandom() error by changing IIS 7.5 settings to Impersonate User = yes. I'm not a Windows admin so I cannot elaborate.
Afterwards import cgi inside python script worked just fine. | 0 | 1 | 0 | 1 | 2012-09-28T12:21:00.000 | 1 | 0 | false | 12,639,930 | 0 | 0 | 0 | 1 | I’m having a very strange issue with running a python CGI script in IIS.
The script is running in a custom application pool which uses a user account from the domain for identity. Impersonation is disabled for the site and Kerberos is used for authentication.
When the account is member of the “Domain Admins” group, ev... |
Storing text files > 1MB in GAE/P | 12,648,928 | 1 | 2 | 223 | 0 | python,google-app-engine,google-docs-api,blobstore,google-cloud-storage | If you're already using the Files API to read and write the files, I'd recommend you use Google Cloud Storage rather than the Blobstore. GCS offers a richer RESTful API (makes it easier to do things like access control), does a number of things to accelerate serving static data, etc. | 0 | 1 | 0 | 0 | 2012-09-28T12:52:00.000 | 3 | 0.066568 | false | 12,640,409 | 0 | 0 | 1 | 2 | I have a Google App Engine app where I need to store text files that are larger than 1 MB (the maximum entity size.
I'm currently storing them in the Blobstore and I make use of the Files API for reading and writing them. Current operations including uploading them from a user, reading them to process and update, an... |
Storing text files > 1MB in GAE/P | 12,641,339 | 0 | 2 | 223 | 0 | python,google-app-engine,google-docs-api,blobstore,google-cloud-storage | Sharing data is more easy in Google Docs (now Google Drive) and Google Cloud Storage. Using Google drive u can also use the power of Google Apps scripts. | 0 | 1 | 0 | 0 | 2012-09-28T12:52:00.000 | 3 | 0 | false | 12,640,409 | 0 | 0 | 1 | 2 | I have a Google App Engine app where I need to store text files that are larger than 1 MB (the maximum entity size.
I'm currently storing them in the Blobstore and I make use of the Files API for reading and writing them. Current operations including uploading them from a user, reading them to process and update, an... |
Vertx SockJS server vs sockjs-tornado | 13,562,205 | 3 | 2 | 1,306 | 0 | python,tornado,vert.x,sockjs | Vertx has build-in clustering support. I haven't tried it with many nodes, but it seemed to work well with a few. Internally it uses hazelcast to organise the nodes.
Vertx also runs on a JVM, which has already many monitoring/admin tools which might be useful. So Vertx seems to me like the "batteries included" solution... | 0 | 1 | 1 | 0 | 2012-09-29T11:32:00.000 | 2 | 0.291313 | false | 12,652,336 | 0 | 0 | 0 | 1 | I've been inspecting two similar solutions for supporting web sockets via sockJS using an independent Python server, and so far I found two solutions.
I need to write a complex, scalable web socket based web application, and I'm afraid it will be hard to scale Tornado, and it seems Vertx is better with horizontal scali... |
Create empty file using python | 31,773,158 | 61 | 311 | 452,830 | 0 | python | Of course there IS a way to create files without opening. It's as easy as calling os.mknod("newfile.txt"). The only drawback is that this call requires root privileges on OSX. | 0 | 1 | 0 | 0 | 2012-09-29T17:22:00.000 | 2 | 1 | false | 12,654,772 | 0 | 0 | 0 | 1 | I'd like to create a file with path x using python. I've been using os.system(y) where y = 'touch %s' % (x). I've looked for a non-directory version of os.mkdir, but I haven't been able to find anything. Is there a tool like this to create a file without opening it, or using system or popen/subprocess? |
/usr/bin/env python opens up python, but ./blabla.py does not execute | 12,663,789 | 0 | 0 | 2,334 | 0 | python,centos | Add #!/usr/bin/env python at the head of your script file.
It tell your system to search for the python interpreter and execute your script with it. | 0 | 1 | 0 | 1 | 2012-09-30T18:20:00.000 | 3 | 0 | false | 12,663,774 | 0 | 0 | 0 | 1 | python blabla.py will execute. But ./blabla.py gives me an error of "no such file or directory" on CentOS6.3.
/usr/bin/env python does open up python properly.
I am new to linux and really would like to get this working. Could someone help?
Thanks in advance!
Note: thanks to all the fast replies!
I did have the #!/usr... |
cx_Freeze. How install service and execute script after install | 36,247,376 | 0 | 9 | 690 | 0 | python,cx-freeze | I think if you don't have a certificate that's impossible. | 0 | 1 | 0 | 0 | 2012-10-01T08:39:00.000 | 1 | 0 | false | 12,669,938 | 1 | 0 | 0 | 1 | I wrote lets scripts for customer. In order not to install python and dependent packages, I packed all to 3 exe-file using cx-freeze. First - winservice, who does most of the work. Second - settings wizard. Third - client for work with winservice. Faced to the task, need after installing the package (made using bdist_... |
failed to set __main__.__loader__ in Python | 15,816,458 | 0 | 12 | 5,239 | 0 | python | I also had this problem. Like mottyg1 said, it happens when the python script is run from a directory containing non-english characters. I can't change the directory name though, and my python script needed to be in the directory in order to perform manipulations on the filenames. So my workaround was simply to move... | 0 | 1 | 0 | 0 | 2012-10-02T18:34:00.000 | 2 | 0 | false | 12,696,151 | 1 | 0 | 0 | 1 | When running any Python script (by double clicking a .py file on Windows 7) I'm getting a Python: failed to set __main__.__loader__ error message. What to do?
More details:
The scripts work on other machines.
The only version of Python installed on the machine on which the scripts don't work is 3.2.
I get the same er... |
How to debug Celery/Django tasks running locally in Eclipse | 19,998,790 | 1 | 29 | 23,443 | 0 | python,eclipse,celery | I create a management command to test task.. find it easier than running it from shell.. | 0 | 1 | 0 | 0 | 2012-10-02T20:57:00.000 | 5 | 0.039979 | false | 12,698,212 | 0 | 0 | 1 | 1 | I need to debug Celery task from the Eclipse debugger.
I'm using Eclipse, PyDev and Django.
First, I open my project in Eclipse and put a breakpoint at the beginning of the task function.
Then, I'm starting the Celery workers from Eclipse by Right Clicking on manage.py from the PyDev Package Explorer and choosing "De... |
suspend embedded python script execution | 12,862,310 | 1 | 1 | 164 | 0 | python,embed | Well, the only way I could come up with is to run the Python engine on a separate thread. Then the main thread is blocked when the python thread is running.
When I need to suspend, I block the Python thread, and let the main thread run. When necessary, the OnIdle of the main thread, i block it and let the python contin... | 0 | 1 | 0 | 0 | 2012-10-03T15:14:00.000 | 1 | 1.2 | true | 12,711,511 | 0 | 0 | 0 | 1 | I have an app that embeds python scripting.
I'm adding calls to python from C, and my problem is that i need to suspend the script execution let the app run, and restore the execution from where it was suspended.
The idea is that python would call, say "WaitForData" function, so at that point the script must suspend (p... |
Telnet Server ubuntu - password stream | 12,788,388 | 1 | 4 | 690 | 0 | python,telnet,ubuntu-12.04 | If you really want to use system's su program, you will need to create a terminal pair, see man 7 pty, in python that's pty.openpty call that returns you a pair of file descriptors, one for you and one for su. Then you have to fork, in the child process change stdin/out/err to slave fd and exec su. In the parent proces... | 0 | 1 | 0 | 0 | 2012-10-03T18:17:00.000 | 1 | 1.2 | true | 12,714,434 | 0 | 0 | 0 | 1 | I am trying to create a Telnet Server using Python on Ubuntu 12.04. In order to be able to execute commands as a different user, I need to use the su command, which then prompts for the password. Now, I know that the prompt is sent to the STDERR stream, but I have no idea which stream I am supposed to send the password... |
Boto reverse the stream | 12,716,129 | 3 | 4 | 636 | 1 | python,stream,twisted,boto | boto is a Python library with a blocking API. This means you'll have to use threads to use it while maintaining the concurrence operation that Twisted provides you with (just as you would have to use threads to have any concurrency when using boto ''without'' Twisted; ie, Twisted does not help make boto non-blocking o... | 0 | 1 | 1 | 0 | 2012-10-03T18:54:00.000 | 2 | 1.2 | true | 12,714,965 | 0 | 0 | 1 | 1 | I have a server which files get uploaded to, I want to be able to forward these on to s3 using boto, I have to do some processing on the data basically as it gets uploaded to s3.
The problem I have is the way they get uploaded I need to provide a writable stream that incoming data gets written to and to upload to boto ... |
Python jug (or other) for embarrassingly parallel jobs in cluster environment with heterogenous tasks | 12,785,406 | 3 | 3 | 522 | 0 | python,parallel-processing,cluster-computing | Author of jug here.
Jug does handle the dependencies very well. If you change any of the inputs or intermediate steps, running jug status will tell you the state of the computation.
There is currently no way to specify that some tasks (what jug calls jobs) should have multiple processes allocated to them. In the past, ... | 0 | 1 | 0 | 0 | 2012-10-05T16:58:00.000 | 1 | 1.2 | true | 12,750,787 | 0 | 0 | 0 | 1 | I have the usual large set of dependent jobs and want to run them effectively in a PBS cluster environment. I have been using Ruffus and am pretty happy with it, but I also want to experiment a bit with other approaches.
One that looks interesting in python is jug. However, it appears that jug assumes that the jobs... |
how to load from Python a dll file written in tcl | 12,754,599 | 2 | 1 | 221 | 0 | python,dll,tcl | The easiest way would be by using the Tkinter package and its built in Tcl interpreter inside your Python Process.
If it is a Tcl extension dll, it makes no real sense to call it from Python without much setup first. | 0 | 1 | 0 | 0 | 2012-10-05T20:54:00.000 | 2 | 1.2 | true | 12,753,896 | 1 | 0 | 0 | 2 | I have a script written in tcl, that load a dll file. I want to load this file in python. I am not sure if the dll file is written in tcl, but because the tcl file imports it I think it is written in tcl. I have tried to use WinDLL("path_to_dll") but I get that there is no module with the provided name. |
how to load from Python a dll file written in tcl | 12,757,979 | 1 | 1 | 221 | 0 | python,dll,tcl | Python and Tcl have substantially different C APIs; there's no reason at all to expect that a binary library written for one would work with the other. It might be possible to write a library that would use the API of whichever library it is loaded into — from the Tcl perspective, this would involve linking against the... | 0 | 1 | 0 | 0 | 2012-10-05T20:54:00.000 | 2 | 0.099668 | false | 12,753,896 | 1 | 0 | 0 | 2 | I have a script written in tcl, that load a dll file. I want to load this file in python. I am not sure if the dll file is written in tcl, but because the tcl file imports it I think it is written in tcl. I have tried to use WinDLL("path_to_dll") but I get that there is no module with the provided name. |
No module named opengl.opengl | 12,791,804 | 0 | 0 | 2,646 | 0 | python,macos,import,pyopengl | Thanks guys! I figured it out.It was infact a separate module which I needed to copy over to the "site-packages" location and it worked fine.So in summary no issues with the path just that the appropriate module was not there. | 0 | 1 | 0 | 0 | 2012-10-06T01:00:00.000 | 2 | 0 | false | 12,755,804 | 1 | 0 | 0 | 1 | I am trying to run a python script on my mac .I am getting the error :-
ImportError: No module named opengl.opengl
I googled a bit and found that I was missing pyopengl .I installed pip.I go to the directory pip-1.0 and then say
sudo pip install pyopengl
and it installs correctly I believe because I got this
Suc... |
How to make an executable for a python project | 12,763,086 | 1 | 1 | 172 | 0 | linux,jar,python-2.7 | If you only want it to run on a Linux machine, using Python eggs is the simplest way.
python snake.egg will try to execute the main.py inside the egg.
Python eggs are meant to be packages, and basically is a zip file with metadata files included. | 0 | 1 | 0 | 1 | 2012-10-06T19:16:00.000 | 2 | 0.099668 | false | 12,763,015 | 0 | 0 | 0 | 1 | Sorry if my title is not correct. Below is the explanation of what i'm looking for.
I've coded a small GUI game (let say a snake game) in python, and I want it to be run on Linux machine. I can run this program by just run command "python snake.py" in the terminal.
However, I want to combine all my .py files into one f... |
Python Shell - Syntax Error | 12,766,135 | 2 | 0 | 923 | 0 | python,python-idle,python-2.3 | I'm guessing that you're running python hello.py within the Python REPL. This won't work; python hello.py is something that starts Python that you'll need to run in your system shell. | 0 | 1 | 0 | 0 | 2012-10-07T04:28:00.000 | 2 | 0.197375 | false | 12,766,124 | 1 | 0 | 0 | 2 | I am very very new to Python. I am trying to get a python program to run by writing 'python hello.py' but every time I do that I get a Syntax Error. Why is that?
However when I open the file and click on run module, it works. Why won't it work if I type 'python hello.py'
Is there anyway I can navigate to the directory ... |
Python Shell - Syntax Error | 12,766,384 | 0 | 0 | 923 | 0 | python,python-idle,python-2.3 | What is the error?
Place python's filepath to the python.exe in your system's PATH, then you can run a python file from anywhere. | 0 | 1 | 0 | 0 | 2012-10-07T04:28:00.000 | 2 | 1.2 | true | 12,766,124 | 1 | 0 | 0 | 2 | I am very very new to Python. I am trying to get a python program to run by writing 'python hello.py' but every time I do that I get a Syntax Error. Why is that?
However when I open the file and click on run module, it works. Why won't it work if I type 'python hello.py'
Is there anyway I can navigate to the directory ... |
Bitnami - /opt/bitnami/python/bin/.python2.7.bin: error while loading shared libraries: libreadline.so.5 | 12,898,508 | 7 | 4 | 1,566 | 0 | python,django,centos,bitnami | Can you execute the following and see if it solves your issue?
. /opt/bitnami/scripts/setenv.sh
(notice the space between the dot and the path to the script)
Also what are you executing that gives you that error? | 0 | 1 | 0 | 1 | 2012-10-10T08:20:00.000 | 1 | 1 | false | 12,814,973 | 0 | 0 | 1 | 1 | I getting the below issue when firing up django or ipython notebook
/opt/bitnami/python/bin/.python2.7.bin: error while loading shared libraries: libreadline.so.5
However libreadline.so.5 exists in my system after locating it as shown below
root@linux:/opt/bitnami/scripts# locate libreadline.so.5
/opt/bitnami/common/li... |
I have installed PIL with Homebrew, but when I try to import it, it says no module exists | 12,818,253 | 1 | 1 | 344 | 0 | python,macos,python-imaging-library,homebrew | I think you would see this issue if you were using the python binary that was not installed by homebrew along with a package that you did install via homebrew. Could you verify that the python binary you are using is not the one that was included in OS X by default? | 0 | 1 | 0 | 0 | 2012-10-10T09:50:00.000 | 1 | 1.2 | true | 12,816,482 | 1 | 0 | 0 | 1 | I have installed PIL with homebrew. It then says that there was a symlink error, and that is can be easily fixed by doing it again, but with a sudo. I did so. Now, when I go into python, and import Image, it doesn't work! I've tried import PIL, import image, import pil, and none of them work. When I try to install it a... |
Distcp with Hadoop streaming job | 12,843,376 | 1 | 1 | 906 | 0 | python,hadoop,hadoop-streaming | You can use S3InputFormat (https://github.com/ATLANTBH/emr-s3-io) to read data directly to you mappers. But beware, in case of job failure you will redownload all data.
So, I suggest to download all data before process it. If you don't need to process whole data at once, you can start you mapreduce after distcp start. ... | 0 | 1 | 0 | 0 | 2012-10-11T08:30:00.000 | 1 | 0.197375 | false | 12,835,329 | 0 | 0 | 0 | 1 | I'll broadly divide the work to be done in two parts:
I have huge data (amounting to approx 1 TB, divided into hundreds of files), which I'm copying from S3 to HDFS via distcp
This data will be acted upon by a hadoop streaming job (a simple mapper and reducer, written in python)
Now, I'll have to wait till all the d... |
Exclude files from causing GAE server restart | 12,847,050 | 0 | 0 | 94 | 0 | python,google-app-engine,go | If you change the files that comprise your application, the application will need to restart in order to serve the new files.
If this is a real sticking point for you, I would suggest hosting the files elsewhere, like a CDN. Your application and the static resources that it employs do not need to be all in the same pla... | 0 | 1 | 0 | 0 | 2012-10-11T17:40:00.000 | 1 | 1.2 | true | 12,845,400 | 0 | 0 | 1 | 1 | Is there a way to avoid GAE server restart when the file within the root of my application changes. I use Go (GAE server is python based) runtime.
The intention is not to reload the server when some of my files (html, css, js files; which are under /static folder) changes. This is to avoid startup time during developm... |
How to configure python32 interpreter under cygwin for eclipse in window ? | 12,863,615 | 0 | 0 | 544 | 0 | python-3.x,cygwin | Probably in /usr/bin, or in windows as {Cygwin Install directory}\bin. For example: D:\Cygwin\bin\
Ensure that you run python3.2.exe within the Cygwin emulation layer. | 0 | 1 | 0 | 0 | 2012-10-12T00:14:00.000 | 1 | 0 | false | 12,850,504 | 1 | 0 | 0 | 1 | I've seen new cygwin for window contains python3.2 files.
Where is the python3.2.exe file under cygwin on window? I need it to configure interpreter for Eclipse in window, but I don't see it. |
Checking a directory continuously for new files | 12,857,136 | 1 | 0 | 384 | 0 | python,multithreading,directory | "Busy" polling is a waste of resources. There are a number of different, operating-system dependant APIs that allow this kind of monitoring.
Some of your choices (for Linux that is) include:
python-inotifyx - simple Python binding to the Linux inotify
python-pyinotify - simple Linux inotify Python bindings
python-gami... | 0 | 1 | 0 | 0 | 2012-10-12T10:26:00.000 | 1 | 1.2 | true | 12,857,063 | 1 | 0 | 0 | 1 | I need to write a program which continuously checks a directory for new files and does some processing whenever there a new file is added. Obviously I will probably need to use some threads but is there any convenient way or pointers that anyone can suggest for achieving this in python ? (FOr both linux and windows) |
How to run a Python project? | 12,873,584 | 3 | 4 | 41,336 | 0 | python,python-idle | Indeed, the command to run a Python file should be run in the command prompt. Python should be in your path variable for it to work flexible.
When the python folder is added to path you can call python everywhere in the command prompt, otherwise just in your python install folder.
The following is from the python websi... | 0 | 1 | 0 | 0 | 2012-10-13T13:26:00.000 | 3 | 0.197375 | false | 12,873,542 | 1 | 0 | 0 | 2 | I have installed the Enthought Python distribution on my computer, but I don't have any idea how to use it. I have PyLab and IDLE but I want to run .py files by typing the following command:
python fileName.py
I don't know where to write this command: IDLE, PyLab or Python.exe or Windows command prompt. When I do thi... |
How to run a Python project? | 12,873,556 | 3 | 4 | 41,336 | 0 | python,python-idle | Open a command prompt: Press ⊞ Win and R at the same time, then type in cmd and press ↵ Enter
Navigate to the folder where you have the ".py" file (use cd .. to go one folder back or cd folderName to enter folderName)
Then type in python filename.py | 0 | 1 | 0 | 0 | 2012-10-13T13:26:00.000 | 3 | 1.2 | true | 12,873,542 | 1 | 0 | 0 | 2 | I have installed the Enthought Python distribution on my computer, but I don't have any idea how to use it. I have PyLab and IDLE but I want to run .py files by typing the following command:
python fileName.py
I don't know where to write this command: IDLE, PyLab or Python.exe or Windows command prompt. When I do thi... |
can I use FUSE with Cython bindings | 12,875,850 | 0 | 0 | 173 | 0 | python,c,cython,fuse | You should use it as a Python Fuse System, then you can write your cython stuff in it's own module and just import that module in your python code. Usually file system related operations are IO bound and not CPU bound so I'm not sure how much of a speedup you would get with cython, but I guess try out and compare the r... | 1 | 1 | 0 | 0 | 2012-10-13T18:18:00.000 | 1 | 0 | false | 12,875,660 | 1 | 0 | 0 | 1 | I know FUSE has bindings for C, C++, Python etc. Which effectively means that I can develop FUSE filesystems using those languages.
I wish to use Cython, as it offers much faster speeds as compared to pure Python. That is stressed in a filesystem. Is it possible to produce a FUSE filesystem by coding in Cython?
As far ... |
How can a python web app open a program on the client machine? | 12,877,893 | 1 | 1 | 351 | 0 | python,linux,web | Note this is not a standard way. Imagine the websites out there had the ability to open Notepad or Minesweeper at their will when you visit or click something.
The way it is done is, you need to have a service which is running on the client machine which can expose certain apis and trust the request from the web apps c... | 0 | 1 | 0 | 0 | 2012-10-13T23:18:00.000 | 3 | 0.066568 | false | 12,877,870 | 0 | 0 | 1 | 1 | I'm going to be using python to build a web-based asset management system to manage the production of short cg film. The app will be intranet-based running on a centos machine on the local network. I'm hoping you'll be able to browse through all the assets and shots and then open any of them in the appropriate program ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.