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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Running IPython after changing the filename of python.exe | 7,727,290 | 0 | 0 | 550 | 0 | python,windows,interpreter,ipython | instead of renaming python.exe, make sure the path to the python you want to run is before the path to other pythons | 0 | 1 | 0 | 0 | 2011-10-11T13:42:00.000 | 4 | 0 | false | 7,727,017 | 1 | 0 | 0 | 4 | If I rename the python interpreter from C:\Python27\python.exe to C:\Python27\python27.exe and run it, it will not complain.
But if I now try to run C:\Python27\Scripts\ipython.exe, it will fail to start because now the python interpreter has a different filename.
My question is: how do I configure IPython (ms windows)... |
Macports duplicate packages | 7,730,290 | 1 | 0 | 156 | 0 | python,macos,macports,homebrew | Macports installs the packages in /opt/local/ and /opt/local/bin.
You can always find your default OS package installation in /bin and /usr/bin.
OS default python installation: /usr/bin/python
Of course, you can choose the macports by having /opt/local/bin first in your path. Macport installation works very well for me... | 0 | 1 | 0 | 0 | 2011-10-11T17:45:00.000 | 1 | 1.2 | true | 7,730,207 | 1 | 0 | 0 | 1 | I have already Python 2.7 on my Mac Os 10.7 and i tried to install py27-mysql package that contains MySQLdb interface for Python. I had run sudo ports install py27-mysql and macports began to install all dependencies for that package python2.7, mysql5, etc that I already has.
Now the questions:
Why that happens?
Wher... |
pydev: find all references to a function | 7,742,529 | 42 | 35 | 10,065 | 0 | python,pydev | Ctrl+Shift+G will find all the references to a function in PyDev (F3 will go to the definition of a function). | 0 | 1 | 0 | 0 | 2011-10-11T19:20:00.000 | 2 | 1.2 | true | 7,731,324 | 1 | 0 | 0 | 1 | This has probably been asked before but I can't seem to find the answer. I've moved from windows to Linux and started using PyDev (Aptana) recently but what I cannot seem to find is how to find all references to a function. |
Get modified date of file on web site without using the Last-Modified header value | 7,732,882 | 0 | 3 | 2,597 | 0 | python,html,bash,shell | If you're retrieving data over http, there is no guarantee that what you're requesting corresponds to a physical file or anything else with a concept of a "last modified" date, so within the http protocol there's no way (other than Last-Modified) to know. You will probably want to retrieve the file if you don't have a ... | 0 | 1 | 0 | 0 | 2011-10-11T21:31:00.000 | 3 | 0 | false | 7,732,779 | 0 | 0 | 0 | 1 | I am attempting to write a bash shell script that will evaluate the modified date of a file on a remote web site and download the file if it is more recent than the local copy. Part of the script is already written. The part that has been developed uses the header Last-Modified parameter. I need to have an alternat... |
Channel disconnect notification in channel api in google app engine | 7,741,709 | 4 | 4 | 1,617 | 0 | javascript,python,google-app-engine,channel-api | The amount of time it takes the Channel API front-end servers to "realize" that a channel is disconnected is contingent on browser implementation.
On well-behaved browsers, we catch the beforeunload event and post a message to our front-end that says, "this client is going away." On other browsers, we may not get the e... | 0 | 1 | 1 | 0 | 2011-10-12T06:29:00.000 | 1 | 1.2 | true | 7,736,105 | 0 | 0 | 1 | 1 | Im using my GAE application on my phone. I face a problem in getting the disconnect notification to /_ah/channel/disconnected in channels api even if i manually close the socket by socket.close() function. the post occurs after a delay of say one minute. Does anyone know the way to speed things up? In my case socket.c... |
identifying the format of files | 7,736,514 | 0 | 4 | 211 | 0 | python,file,identification,imghdr | There are standard modules imghdr and sndhdr for graphic and sound files, respectively. | 0 | 1 | 0 | 0 | 2011-10-12T07:13:00.000 | 3 | 0 | false | 7,736,480 | 1 | 0 | 0 | 1 | In linux, we have a utility called “file”, which helps us to determine the identification of a file. Is there any python module that can do the same job?
I don't prefer to use subprocess.Popen(['file', 'blah.blah']),
because it is platform dependent. For instance, windows do not have “file” (although it can be download... |
Can't set Python environment PATH variable? | 10,164,902 | 3 | 1 | 15,504 | 0 | python,variables,path,environment | I know it's been a while, but I hope this could help someone else.
I had the same problem and the only way to making it work was running cmd or powershell as administrator. | 0 | 1 | 0 | 0 | 2011-10-12T16:23:00.000 | 5 | 0.119427 | false | 7,743,281 | 1 | 0 | 0 | 2 | So for some reason, my computer refuses to see the environment PATH variable. In the path variable, I have:
C:\Python32;
listed, along with all of the other programs, but it doesn't work if I type, "python" into the command window. However, I can type "python" into the run window, and have it run the correct interprete... |
Can't set Python environment PATH variable? | 53,708,878 | 4 | 1 | 15,504 | 0 | python,variables,path,environment | I faced the same issue.
However, in my case, I went through the documentation from python and found where I was making mistake. In the latest python versions, if you type 'python' in cmd, it will show error.
At the same time, the command that worked for me was 'py'.
So I recommend anyone facing a similar problem to t... | 0 | 1 | 0 | 0 | 2011-10-12T16:23:00.000 | 5 | 0.158649 | false | 7,743,281 | 1 | 0 | 0 | 2 | So for some reason, my computer refuses to see the environment PATH variable. In the path variable, I have:
C:\Python32;
listed, along with all of the other programs, but it doesn't work if I type, "python" into the command window. However, I can type "python" into the run window, and have it run the correct interprete... |
AppEngine: switching to Python 2.7 | 7,744,371 | 5 | 4 | 839 | 0 | python,google-app-engine | There is no way to avoid changing the app ID, but you can request that the old ID be aliased so requests to old_appid.appspot.com will be handled by the new application. If you're serving the application on your own domain, of course, the app ID is irrelevant.
The Master/Slave datastore will almost certainly never be s... | 0 | 1 | 0 | 0 | 2011-10-12T16:54:00.000 | 1 | 1.2 | true | 7,743,653 | 0 | 0 | 1 | 1 | For tons of reasons, I would like to go ahead and switch to Python 2.7. The new python version requires using the High Replication Datastore. As far as I can see, converting to it is not really possible: the only way is to create a new app, with new ID, and copy over the datastore. Changing my app ID is something I am ... |
Python quit unexpectedly while running Django | 7,747,494 | 0 | 1 | 1,009 | 0 | python,django,crash,interpreter,osx-lion | It looks like its the mysql-extension that crashes, if you have XCode you can try to make sure you have the latest one compiled locally and installed. | 0 | 1 | 0 | 0 | 2011-10-12T20:13:00.000 | 1 | 0 | false | 7,745,997 | 0 | 0 | 1 | 1 | I'm running Python 2.7.1 on 64-bit Mac OSX Lion. Python keeps crashing while I'm running my local Django 1.3 development server. The error log is below.
This is starting to get annoying. Any ideas?
Process: Python [22917] Path:
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Co... |
What are the advantages of using syslog over other logging facilites? | 31,257,970 | 4 | 6 | 3,342 | 0 | python,logging,syslog | The advantages of using syslog where available (all modern *nix systems, including Linux, FreeBSD, OS-X etc.) are numerous:
Performance is better: syslog is compiled C and most importantly it works as a separate process so all your logging operations become non-blocking to the applications, processes, and threads that... | 0 | 1 | 0 | 1 | 2011-10-13T07:07:00.000 | 3 | 0.26052 | false | 7,750,560 | 0 | 0 | 0 | 1 | We are using a basic python log server based on BaseHTTPServer to aggregate our python logs on an ubunutu server. This solution has fulfilled our needs... until now. The number of programs dumping to this log server has grown and now the logger is crippling the system.
Now that we are back to the drawing board, we ... |
account(s) management over multiple tenants | 7,757,039 | 2 | 2 | 126 | 0 | python,google-app-engine,namespaces,user-accounts | If 'user identity' can span tenants (your apps), then keep user entities in a common namespace (the default namespace works fine for that, and that's the default when a request begins). Anything specific to a tenant (e.g., what authorization a user identity has for a specific tenant) can be stored where it is most conv... | 0 | 1 | 0 | 0 | 2011-10-13T14:58:00.000 | 1 | 1.2 | true | 7,756,132 | 0 | 0 | 1 | 1 | i have an app with multiple tenants on GAE.
over the 'master' (which is a tenant on its own) i let people register and create a subapp/tenant where the creator is the owner of the app.
what is the best way to manage the user accounts?
lets say USER_A creates APP_A and USER_B creates APP_B.
so there are 2 users and 2 ... |
PyDev project for Google App Engine not finding webapp2 | 17,769,623 | 0 | 6 | 5,907 | 0 | python,eclipse,google-app-engine,pydev | adding ${GOOGLE_APP_ENGINE}/lib/webapp2-2.5.2 to the "External Libraries" worked for me.
App Engine SDK ver:1.8.2
Python version: 2.7 | 0 | 1 | 0 | 0 | 2011-10-13T16:00:00.000 | 5 | 0 | false | 7,756,981 | 0 | 0 | 1 | 3 | I am attempting to try out Google App Engine with python. Being familiar with Eclipse, I decided to use PyDev. After some trouble, I have a hello world program working... almost. It cannot find the webapp2 import, telling me it is unresolved. I have followed all of the instructions I can find, and have the google a... |
PyDev project for Google App Engine not finding webapp2 | 7,789,156 | 3 | 6 | 5,907 | 0 | python,eclipse,google-app-engine,pydev | The current SDK does not support the Python 2.7 runtime on the dev_appserver, so it doesn't bundle new libraries like webapp2. If all you need is the libraries, you can download them and include them in your app yourself, but if you need extra runtime features like multithreading and PIL, you will need to do your devel... | 0 | 1 | 0 | 0 | 2011-10-13T16:00:00.000 | 5 | 0.119427 | false | 7,756,981 | 0 | 0 | 1 | 3 | I am attempting to try out Google App Engine with python. Being familiar with Eclipse, I decided to use PyDev. After some trouble, I have a hello world program working... almost. It cannot find the webapp2 import, telling me it is unresolved. I have followed all of the instructions I can find, and have the google a... |
PyDev project for Google App Engine not finding webapp2 | 8,238,441 | 3 | 6 | 5,907 | 0 | python,eclipse,google-app-engine,pydev | I encounter this problem, too.
And I follow TorelTwiddler's instruction -> he's right, there's no webapp2.
You have to add ${GOOGLE_APP_ENGINE}/lib/webapp2 to the "External Libraries".
This occurs because(I guess) you only change the interpreter of the project, not create a whole new GAE project with PyDev.
This action... | 0 | 1 | 0 | 0 | 2011-10-13T16:00:00.000 | 5 | 0.119427 | false | 7,756,981 | 0 | 0 | 1 | 3 | I am attempting to try out Google App Engine with python. Being familiar with Eclipse, I decided to use PyDev. After some trouble, I have a hello world program working... almost. It cannot find the webapp2 import, telling me it is unresolved. I have followed all of the instructions I can find, and have the google a... |
open (and maintain) remote connection with python | 7,757,147 | 0 | 1 | 696 | 0 | python,sockets,ssh,scp | This is not really python specific, but it probably depends on what libraries you can use.
What you need is a way to send files through a single connection.
(This is probably better suited to superuser or severfault.com though.)
Create tarfile locally, upload it and unpack at target?
Maybe you could even run 'tar x... | 0 | 1 | 1 | 1 | 2011-10-13T16:07:00.000 | 3 | 0 | false | 7,757,059 | 0 | 0 | 0 | 1 | I'm using Python to transfer (via scp) and database a large number of files. One of the servers I transfer files to has odd ssh config rules to stop too many ssh requests from a single location. The upshot of this is that my python script, currently looping through files and copying via os.system, hangs after a few f... |
Python - apache - windows 7 - wamp | 7,762,202 | 0 | 0 | 255 | 0 | python,windows,apache | Common problems with Apache/mod_wsgi installation, if that is what you are trying to install are:
Installing a mix of 32 and 64 bit binaries for Apache, Python and mod_wsgi.
Not installing Python for all users on the system.
Do either of those and Apache will not startup properly.
Since you don't say what exactly fai... | 0 | 1 | 0 | 0 | 2011-10-13T17:43:00.000 | 2 | 0 | false | 7,758,160 | 0 | 0 | 0 | 1 | I tried millions of times to install python with apache on my windows 7 32 bit. But failed. Can anybody tell me the simplest way to get it work??? |
How do I separate my executable files from my library files? | 7,786,309 | 0 | 1 | 629 | 0 | php,python,project-management | For my PHP projects, I follow a very Java-esque naming convention (my background):
index.php
/classes/{organization type: net, org, com}/{organization name}/{component}
/includes/ <- general configuration, etc; all non-executable;
/lib/ <- third party libraries that are tied to specific releases; not modified, patche... | 0 | 1 | 0 | 1 | 2011-10-14T14:11:00.000 | 2 | 0 | false | 7,768,881 | 0 | 0 | 0 | 1 | I still haven't gotten an answer that I'm happy with. Please do submit some answers if you have a nice system for your Python or PHP projects.
I'm having a management issue with my PHP and Python projects. They both have two kinds of code files: files that should be run in the console or web browser, and files that sh... |
in Python and linux how to get given user's id | 7,770,065 | -5 | 34 | 48,007 | 0 | python,linux | You could just parse /etc/passwd, it's stored there. | 0 | 1 | 0 | 0 | 2011-10-14T15:37:00.000 | 4 | -1 | false | 7,770,034 | 0 | 0 | 0 | 1 | There is os.getuid() which "Returns the current process’s user id.". But how do I find out any given user's id? |
reliable way to deploy new code into a production celery cluster without pausing service | 13,168,517 | 4 | 9 | 1,747 | 0 | python,django,celery | The challenging part here seems to be identifying which celery tasks are new versus old. I would suggest creating another vhost in rabbitmq and performing the following steps:
Update django web servers with new code and reconfigure to point to the new vhost.
While tasks are queuing up in the new vhost, wait for celer... | 0 | 1 | 0 | 0 | 2011-10-14T19:05:00.000 | 2 | 1.2 | true | 7,772,378 | 0 | 0 | 1 | 2 | I have a few celery nodes running in production with rabbitmq and I have been handling deploys with service interruption. I have to take down the whole site in order to deploy new code out to celery. I have max tasks per child set to 1, so in theory, if I make changes to an existing task, they should take effect when t... |
reliable way to deploy new code into a production celery cluster without pausing service | 7,780,065 | 0 | 9 | 1,747 | 0 | python,django,celery | a kind of work around for you can be to set the config variable MAX_TASK_PER_CHILD.
This variable specify the number of task that a Pool Worker execute before kill himself.
Off course when a new Pool Worker is executed this will load the new code.
On my system normally I use to restart celery leaving other task running... | 0 | 1 | 0 | 0 | 2011-10-14T19:05:00.000 | 2 | 0 | false | 7,772,378 | 0 | 0 | 1 | 2 | I have a few celery nodes running in production with rabbitmq and I have been handling deploys with service interruption. I have to take down the whole site in order to deploy new code out to celery. I have max tasks per child set to 1, so in theory, if I make changes to an existing task, they should take effect when t... |
Eclipse/PyDev: Open Interactive console when program starts | 7,791,891 | 0 | 0 | 375 | 0 | python,eclipse,pydev | Currently not... please enter a feature request for that (it should be relatively straightforward adding a preference where you can choose an interpreter which would be used to open an interactive console when you open Eclipse). | 0 | 1 | 0 | 0 | 2011-10-14T21:01:00.000 | 1 | 1.2 | true | 7,773,513 | 0 | 0 | 0 | 1 | I find myself opening the interactive shell nearly every time I launch Eclipse. To save my lazy self a few extra clicks every day, I started wonder: is there is a way to get an interactive console to open automatically on start-up of Eclipse/PyDev?
Thanks! |
How do I open a .py file in IDLE for editing without starting a fresh interpreter session? | 8,020,235 | 2 | 2 | 8,877 | 0 | python,linux,python-idle | In IDLE's menu, go to Options -> Configure IDLE... -> General. Under "At Startup" select "Open Edit Window" instead of "Open Shell Window", then hit Apply or Ok. IDLE will save this setting and from now on will open just an editor window when you open a file. | 0 | 1 | 0 | 0 | 2011-10-15T01:56:00.000 | 2 | 1.2 | true | 7,775,254 | 1 | 0 | 0 | 2 | Python for Windows has built in support for right clicking a .py file, and selecting, "edit with IDLE", instead of the usual action, which is running the file.
How can I accomplish this same setup on Linux? I am running Mint Julia, a Debian-type distribution. Selecting my default program from the shortcut menu will onl... |
How do I open a .py file in IDLE for editing without starting a fresh interpreter session? | 8,353,380 | 0 | 2 | 8,877 | 0 | python,linux,python-idle | You'll need to change the command to start IDLE itself to include a "-e". Choose "use a custom command" and type idle -e | 0 | 1 | 0 | 0 | 2011-10-15T01:56:00.000 | 2 | 0 | false | 7,775,254 | 1 | 0 | 0 | 2 | Python for Windows has built in support for right clicking a .py file, and selecting, "edit with IDLE", instead of the usual action, which is running the file.
How can I accomplish this same setup on Linux? I am running Mint Julia, a Debian-type distribution. Selecting my default program from the shortcut menu will onl... |
Way to disable "System" service or process for a short period of time? Python | 7,788,671 | 1 | 0 | 160 | 0 | python,windows,service,process | As a general rule, if Windows says that it needs a file, you will be very hard pressed to get it to completely relinquish control. While that process is running, it will have exclusive rights (read, write, and execute) to the file (or files) in question, so I will highly doubt that there will be an effective hack while... | 0 | 1 | 0 | 0 | 2011-10-17T01:35:00.000 | 1 | 1.2 | true | 7,788,632 | 1 | 0 | 0 | 1 | I'm not sure if it is a service or process, but is there a way to disable it or stop it? A file which I'm trying to copy is being run by the system but the system does not require this .sys file.
If there is way in python I would be even more ecstatic to read the response. |
What data structure/db should I use for storing the file tree structure? | 7,789,286 | 0 | 0 | 257 | 0 | python,database,database-design,data-structures | I think you should declare a class which has a list of its own type. Basically a simple tree structure.
For ls:
Just dispay all the child recursively.
For any new addition:
Add it to the parent directory node's child list as a child. | 0 | 1 | 0 | 0 | 2011-10-17T04:01:00.000 | 1 | 0 | false | 7,789,253 | 0 | 0 | 0 | 1 | I am trying to write an application(I am using python) to have a copy of a remote machines directory structure in my local machine (not the actual content of the files in the remote machine).
Once I store it in my local machine, I want to be be able to perform the following operations on my local copy of the tree struc... |
Can Native Client (NaCl) programs be written in languages other than C or C++? | 7,844,298 | 8 | 20 | 4,357 | 0 | python,google-chrome,google-chrome-extension,go,google-nativeclient | Go used to compile to NaCl, but NaCl's been such a moving target that the support was removed from Go. It'll probably be resurrected at some point if/when NaCl settles down. | 0 | 1 | 0 | 0 | 2011-10-17T23:12:00.000 | 4 | 1 | false | 7,800,693 | 0 | 0 | 0 | 1 | Would it be possible to write a native client application in Python or Go that could then run in the browser? |
Does Berkeley DB only support one processor operation | 8,835,081 | 1 | 1 | 237 | 1 | python,nginx,berkeley-db | it supports
A Single Process With One Thread
A Single Process With Multiple Threads
Groups of Cooperating Processes
Groups of Unrelated Processes | 0 | 1 | 0 | 0 | 2011-10-19T06:52:00.000 | 1 | 1.2 | true | 7,817,567 | 0 | 0 | 0 | 1 | I use Berkeley DB(BDB) in nginx. When a request arrives, nginx passes the URI as a key to BDB and checks if that key has a value in BDB file.
I actually did in an example. I add some data in BDB, and run nginx, it's OK. I can access it.
But when I add some data in running BDB with nginx (using Python), I can't get the... |
What happens if two python scripts want to write in the same file? | 7,820,272 | 3 | 15 | 6,557 | 0 | python,file,io | A better solution is to implement a resource manager (writer) to avoid opening the same file twice. This manager could use threading synchronization mechanisms (threading.Lock) to avoid simultaneous access on some platforms. | 0 | 1 | 0 | 0 | 2011-10-19T10:41:00.000 | 5 | 0.119427 | false | 7,820,021 | 1 | 0 | 0 | 4 | I have a pipeline which at some point splits work into various sub-processes that do the same thing in parallel. Thus their output should go into the same file.
Is it too risky to say all of those processes should write into the same file? Or does python try and retry if it sees that this resource is occupied? |
What happens if two python scripts want to write in the same file? | 7,821,856 | 2 | 15 | 6,557 | 0 | python,file,io | How about having all of the different processes write their output into a queue, and have a single process that reads that queue, and writes to the file? | 0 | 1 | 0 | 0 | 2011-10-19T10:41:00.000 | 5 | 0.07983 | false | 7,820,021 | 1 | 0 | 0 | 4 | I have a pipeline which at some point splits work into various sub-processes that do the same thing in parallel. Thus their output should go into the same file.
Is it too risky to say all of those processes should write into the same file? Or does python try and retry if it sees that this resource is occupied? |
What happens if two python scripts want to write in the same file? | 50,034,098 | 0 | 15 | 6,557 | 0 | python,file,io | Use multiprocessing.Lock() instead of threading.Lock(). Just a word of caution! might slow down your concurrent processing ability because one process just waits for the lock to be released | 0 | 1 | 0 | 0 | 2011-10-19T10:41:00.000 | 5 | 0 | false | 7,820,021 | 1 | 0 | 0 | 4 | I have a pipeline which at some point splits work into various sub-processes that do the same thing in parallel. Thus their output should go into the same file.
Is it too risky to say all of those processes should write into the same file? Or does python try and retry if it sees that this resource is occupied? |
What happens if two python scripts want to write in the same file? | 7,820,062 | 8 | 15 | 6,557 | 0 | python,file,io | In general, this is not a good idea and will take a lot of care to get right. Since the writes will have to be serialized, it might also adversely affect scalability.
I'd recommend writing to separate files and merging (or just leaving them as separate files). | 0 | 1 | 0 | 0 | 2011-10-19T10:41:00.000 | 5 | 1.2 | true | 7,820,021 | 1 | 0 | 0 | 4 | I have a pipeline which at some point splits work into various sub-processes that do the same thing in parallel. Thus their output should go into the same file.
Is it too risky to say all of those processes should write into the same file? Or does python try and retry if it sees that this resource is occupied? |
Can I deploy a django app which uses sqlite3 as backend on google app engine? | 7,838,935 | 5 | 3 | 582 | 1 | python,django,google-app-engine,web-applications,sqlite | Unfortunately, no you can't. Google App Engine does not allow you to write files, and that is needed by SQLite.
Until recently, it had no support of SQL at all, preferring a home-grown solution (see the "CAP theorem" as for why). This motivated the creation of projects like "Django-nonrel" which is a version of Django ... | 0 | 1 | 0 | 0 | 2011-10-20T15:52:00.000 | 1 | 0.761594 | false | 7,838,667 | 0 | 0 | 1 | 1 | I created a simple bookmarking app using django which uses sqlite3 as the database backend.
Can I upload it to appengine and use it? What is "Django-nonrel"? |
How do I block all network access for a script? | 7,843,516 | 2 | 4 | 291 | 0 | python,c,sandbox | Unless you're using a sandboxed version of Python (using PyPy for example), there is no reliable way to switch-off network access from within the script itself. Of course, you could run under a VM with the network access shut off. | 0 | 1 | 0 | 1 | 2011-10-20T22:55:00.000 | 3 | 0.132549 | false | 7,843,238 | 0 | 0 | 0 | 3 | Suppose I have a script written in Python or Ruby, or a program written in C. How do I ensure that the script has no access to network capabilities? |
How do I block all network access for a script? | 7,843,275 | 5 | 4 | 291 | 0 | python,c,sandbox | You more or less gave a generic answer yourself by tagging it with "sandbox" because that's what you need, some kind of sandbox. Things that come to mind are: using JPython or JRuby that run on the JVM. Within the JVM you can create a sandbox using a policy file so no code in the JVM can do thing you don't allow.
For C... | 0 | 1 | 0 | 1 | 2011-10-20T22:55:00.000 | 3 | 1.2 | true | 7,843,238 | 0 | 0 | 0 | 3 | Suppose I have a script written in Python or Ruby, or a program written in C. How do I ensure that the script has no access to network capabilities? |
How do I block all network access for a script? | 7,843,519 | 0 | 4 | 291 | 0 | python,c,sandbox | Firewalls can block specific applications or processes from accessing the network. ZoneAlarms is a good one that I have used to do exactly what you want in the past. So it can be done programatically, but I don't know near enough about OS programming to offer any advice on how to go about doing it. | 0 | 1 | 0 | 1 | 2011-10-20T22:55:00.000 | 3 | 0 | false | 7,843,238 | 0 | 0 | 0 | 3 | Suppose I have a script written in Python or Ruby, or a program written in C. How do I ensure that the script has no access to network capabilities? |
Subsuming the Linux packet processing stack | 7,851,867 | 1 | 2 | 197 | 0 | python,linux,networking | Are you receiving and processing the packet and only need to suppress the ICMP port-unreachable? If so, maybe just add an entry to the iptables OUTPUT chain to drop it? | 0 | 1 | 1 | 0 | 2011-10-21T15:37:00.000 | 1 | 1.2 | true | 7,851,817 | 0 | 0 | 0 | 1 | We occasionally have to debug glitchy Cisco routers that don't handle the TCP Selective Acknowledgment (SACK) options correctly. This causes our TCP sessions to die when routed through an IPTABLES port redirection rule.
To help with the diagnosis, I've been constructing a python-based utility to construct a sequence of... |
gnu-binutils-strings utf-8 instead of utf-16 or ascii | 7,864,249 | 4 | 3 | 573 | 0 | python,unix,utf-8,utf-16,binutils | I'm not experienced with strings, but the version I have (2.21.51.20110605) has an 8-bit encoding option (-eS) that would work with utf-8 text. It must have to cast a wide net looking for 'text' delimited by non-printable characters (value < 32). I'd expect a lot of noise. A test on a random executable showed the -eS (... | 0 | 1 | 0 | 0 | 2011-10-23T02:35:00.000 | 1 | 1.2 | true | 7,863,986 | 0 | 0 | 0 | 1 | I've noticed gnu-binutils-strings can printout utf-16 content in a file - is it possible for the program to print out utf-8 strings? if so, which arguments are appropriate? i'm working in a python environment using subprocess and would like to work with the output from gnu-binutils-strings that a subprocess.Popen call ... |
Python - SCP vs SSH for multiple computers and multiple files | 7,869,588 | 0 | 0 | 1,890 | 0 | python,ssh,scp | scp lets you:
Copy entire directories using the -r flag: scp -r g0:labgroup/ .
Specify a glob pattern: scp 'g0:labgroup/assignment*.hs' .
Specify multiple source files: scp 'g0:labgroup/assignment1*' 'g0:labgroup/assignment2*' .
Not sure what sort of globbing is supported, odds are it just uses the shell for this. I'... | 0 | 1 | 0 | 1 | 2011-10-23T22:00:00.000 | 4 | 0 | false | 7,869,552 | 0 | 0 | 0 | 1 | Python 2.4.x (cannot install any non-stock modules).
Question for you all. (assuming use of subprocess.popen)
Say you had 20 - 30 machines - each with 6 - 10 files on them that you needed to read into a variable.
Would you prefer to scp into each machine, once for each file (120 - 300 SCP commands total), reading each... |
How to make python modules compatible with different OS? | 7,873,222 | 1 | 1 | 133 | 0 | python | You're asking a very general question. Perhaps overly general.
Generally, unless your application is relatively simple, it's impossible to guarantee that it is going to work on Linux and Mac OS X by only having Windows available. You will have to at least test it on Linux. Mac OS X is rather similar to Linux in many as... | 0 | 1 | 0 | 0 | 2011-10-24T08:50:00.000 | 2 | 0.099668 | false | 7,873,170 | 0 | 0 | 0 | 2 | I have windows xp, I have found some python libraries that only work for windows xp and thus if you have a mac os or linux or windows 7, you can't download my program because it won't work, how to make these libraries compatible with these OS, I can't ask the creator of the libraries so I have to download the source co... |
How to make python modules compatible with different OS? | 7,873,269 | 0 | 1 | 133 | 0 | python | Your question is quite broad:
1) Development and testing:
Use VMs, absolutely, they are great for testing on OS you don't natively use, and to have a clean environment for testing (eg. test even windows stuff on a clean windows VM if you can, you might find out you're missing some dependencies that you took for granted... | 0 | 1 | 0 | 0 | 2011-10-24T08:50:00.000 | 2 | 1.2 | true | 7,873,170 | 0 | 0 | 0 | 2 | I have windows xp, I have found some python libraries that only work for windows xp and thus if you have a mac os or linux or windows 7, you can't download my program because it won't work, how to make these libraries compatible with these OS, I can't ask the creator of the libraries so I have to download the source co... |
Copy data from the clipboard on Linux, Mac and Windows with a single Python script | 7,889,078 | 2 | 4 | 5,923 | 0 | python,windows,linux,macos,clipboard | Polling is NOT robust/reliable.
You cannot determine if data has changed (on windows anyway) without pasting it into a buffer for inspection. This requires opening the clipboard. If you do this in a loop, you're going to collide with other apps. i.e. the app where the user is copying another item onto the clipboard. Th... | 0 | 1 | 0 | 0 | 2011-10-24T19:59:00.000 | 5 | 0.07983 | false | 7,881,230 | 0 | 0 | 0 | 1 | I am trying to create a script in Python that will collect data put in the clipboard by the user and preferably save it as a list or in a text file or string/array/variable to work with later on.
This should work on Linux all versions (I would assume Ubuntu), Mac OS all versions and Windows all versions. I am not sure... |
Which executable does a core file belong to? | 7,881,936 | 5 | 1 | 522 | 0 | python,debugging,core | The "file" program can tell you; type "file core". | 0 | 1 | 0 | 0 | 2011-10-24T20:58:00.000 | 1 | 1.2 | true | 7,881,926 | 1 | 0 | 0 | 1 | I have a python program that spawns a number of processes, one of which segfaults and dumps core. Is there a way to find out which executable produced the resulting core file? |
Which is the best IDE for Python For Windows | 7,899,770 | 4 | 43 | 401,989 | 0 | python,ide | U can use eclipse. but u need to download pydev addon for that. | 0 | 1 | 0 | 0 | 2011-10-26T07:18:00.000 | 4 | 0.197375 | false | 7,899,732 | 1 | 0 | 0 | 1 | I am new to python and I am using simple gedit application on linux machine to write python code, however its very difficult to manage the indentations of my code. I am looking for any Python IDEs that provides some functionality and should not slow down my P4 machine. |
Modify `PATH` environment variable globally and permanently using Python | 7,930,947 | 0 | 0 | 2,054 | 0 | python,cross-platform,environment-variables,distutils | Distutils doesn’t set environment variables. On Windows, this would imply mucking with the registry; on UNIX, it would require to find out the right shell configuration file (which is not trivial) and edit it, which is just not done in this culture: people are told to edit their $PATH or to use full paths to the progr... | 0 | 1 | 0 | 0 | 2011-10-27T10:14:00.000 | 2 | 0 | false | 7,914,505 | 1 | 0 | 0 | 1 | Is that possible to modify PATH environment variable, globally and permanently, in a platform-independent way using Python (distutils)?
Background
I have some application (a plugin for Serna XML Editor), and now I'm going to make an installer for it, probably using python distutils (setup.py). After the installation se... |
python calling a subprocess that runs in parallel | 7,918,418 | 1 | 0 | 245 | 0 | python,subprocess,parallel-processing | If the subprocess is really capable of multicore operation, it shouldn't matter how you spawn it. You don't (and generally, can't) "request" more cores for it -- the OS will automatically give it whatever resources are available.
I suspect the answer lies with the commercial program in question rather than with the par... | 0 | 1 | 0 | 0 | 2011-10-27T15:32:00.000 | 1 | 0.197375 | false | 7,918,395 | 1 | 0 | 0 | 1 | I have code that calls a commercial program to run as a subprocess using the subprocess module.
The commercial program is capable of running in parallel, but I have noticed that only 1 processor is being used when the subprocess is running.
Is there a simple way to run a serial python program that requests more resou... |
get amount of used resources in app engine | 7,934,948 | 0 | 0 | 34 | 0 | python,google-app-engine | Unfortunately this is not possible, there is no API that you can use for this.
Looking at the App Engine roadmap there is no such feature coming along any time soon.
The only thing i can recommend is you sign up for billing and recieve the 50$ free quota, it's here till 31 october. You can enable billing and disable it... | 0 | 1 | 0 | 0 | 2011-10-28T16:15:00.000 | 1 | 1.2 | true | 7,931,936 | 0 | 0 | 1 | 1 | I am thinking about implementing resource throttling in my application in google app engine.
My idea is checking whether I am running out of resources (for example, bandwidth) and disabling part of the website, using the final part of the available daily traffic to inform the user that the site is running in a "resourc... |
Send commands to an interactive shell from Python | 7,954,357 | 0 | 1 | 3,763 | 0 | python,shell,interactive | It will not be easy at all.
You will have to know if meterpreter has any means for other programs to communicate with it.
If it doesn't, you might want to go through hacking through it, e.g using OS pipes, etc to be able to get it to work.
In any case, the code needed for such communication might be beyond Python's pow... | 0 | 1 | 0 | 1 | 2011-10-31T12:54:00.000 | 2 | 0 | false | 7,953,996 | 0 | 0 | 0 | 1 | Is there a way to send command to another interactive shell ? Let's take the example of the meterpreter shell used in metasploit. Could it be a way to say command to this shell from python code, as soon as I get control of a computer and have a meterpreter shell to play with ?
I mean All this from python code. |
Distributing python-written executable with veusz | 7,996,527 | 1 | 0 | 272 | 0 | python,py2exe,veusz | Veusz runs its user interface in a separate python process so that it does not block python. If you look at veusz/embed.py, it tries to start up python or a veusz executable. You'd need to modify embed.py to start your .exe (sys.executable) if frozen instead of veusz and pass some special parameter which your program w... | 0 | 1 | 0 | 0 | 2011-11-01T00:54:00.000 | 1 | 0.197375 | false | 7,961,431 | 1 | 0 | 0 | 1 | I would like to distribute an application written in python as a .exe file. I have already been able to do this using py2exe, but now I have incorporated the veusz library into my code. Ideally my program should open up a veusz plot (as it does on my computer, which has python, numpy, etc. all installed). However, I wa... |
How do I make python processes run with correct process name? | 7,977,112 | 9 | 4 | 654 | 0 | python,linux | Add a shebang to the Python file in question, make the Python file executable (e.g. by chmod a+x ./logserver.py) and start it directly by ./logserver.py.
A shebang is a line telling the kernel which interpreter to use. It's simply a line like #!/usr/bin/env python at the very beginning of the file. | 0 | 1 | 0 | 0 | 2011-11-02T07:20:00.000 | 2 | 1.2 | true | 7,976,926 | 1 | 0 | 0 | 1 | I have a few long term processes and temporary processes in Python. While shell and C programs run under their own names, all Python processes run as 'python filename.py', which makes it tough to identify processes.
How can I make python processes show up as 'logserver.py' or such in Linux? I use Python 2.7 in Ubuntu ... |
Create 32-bit exe's from python code on 64-bit machine | 7,988,865 | 8 | 12 | 15,094 | 0 | python | To produce 32 bit executables you need to install 32-bit versions of Python and cx_freeze. | 0 | 1 | 0 | 0 | 2011-11-02T23:50:00.000 | 3 | 1.2 | true | 7,988,772 | 1 | 0 | 0 | 3 | I have already created a 64-bit program for windows using cx freeze on a 64-bit machine. I am using Windows 7 64-bit Home premium. py2exe is not working because as i understand it does not work with python 3.2.2 yet. Is there an option i have to specify in cx freeze to compile in 32-bit instead of 64-bit.
Thanks! |
Create 32-bit exe's from python code on 64-bit machine | 7,989,276 | 0 | 12 | 15,094 | 0 | python | All the "produce an executable from Python code" methods I know of basically create a file that bundles up the Python interpreter with the Python code you want to execute inside a single file. It is nothing at all like compiling C code to an executable; Python is just about impossible to compile to machine code in any ... | 0 | 1 | 0 | 0 | 2011-11-02T23:50:00.000 | 3 | 0 | false | 7,988,772 | 1 | 0 | 0 | 3 | I have already created a 64-bit program for windows using cx freeze on a 64-bit machine. I am using Windows 7 64-bit Home premium. py2exe is not working because as i understand it does not work with python 3.2.2 yet. Is there an option i have to specify in cx freeze to compile in 32-bit instead of 64-bit.
Thanks! |
Create 32-bit exe's from python code on 64-bit machine | 18,043,350 | 4 | 12 | 15,094 | 0 | python | In addition to the answers already given:
To compile/freeze python code for different architectures (x86/x64), install both, x86 and x64 versions of python, to your system and corresponding variations of all required modules and libraries to your python installations so both installations have the same (required) set ... | 0 | 1 | 0 | 0 | 2011-11-02T23:50:00.000 | 3 | 0.26052 | false | 7,988,772 | 1 | 0 | 0 | 3 | I have already created a 64-bit program for windows using cx freeze on a 64-bit machine. I am using Windows 7 64-bit Home premium. py2exe is not working because as i understand it does not work with python 3.2.2 yet. Is there an option i have to specify in cx freeze to compile in 32-bit instead of 64-bit.
Thanks! |
How can I stop the debugger server from pydev? | 7,993,203 | 0 | 1 | 525 | 0 | python,eclipse,pydev | This was a bug -- and it was fixed in the latest version (PyDev 2.2.4), so, please upgrade to the latest version and that should be working already. | 0 | 1 | 0 | 0 | 2011-11-03T00:02:00.000 | 1 | 0 | false | 7,988,856 | 0 | 0 | 1 | 1 | I am using the pydev remote debugger feature for my application.
When I try to stop the debugger server via the stop button it shows on the console that the server is successfully terminated but it isn't because it is still accepting new connections on its default port (5678).
Do you know how can I stop the server in a... |
Connect to putty and type few command | 7,991,590 | 3 | 6 | 59,795 | 0 | python,putty | you can use code similar to:
command = "plink.exe -ssh username@" + hostname + " -pw password -batch \"export DISPLAY='" + hostname + "/unix:0.0' ; "
which will open an ssh to the desired hostname using username and password
shutdown:
command += "sudo /sbin/halt\""
reboot:
command += "sudo /sbin/reboot\""
add your othe... | 0 | 1 | 0 | 1 | 2011-11-03T07:36:00.000 | 4 | 0.148885 | false | 7,991,529 | 0 | 0 | 0 | 1 | I want to connect to putty and want to do few step:
login to Putty
type few command to bring down the server
Traverse to the particular path
Remove the file from the directory
Again start the server
I need to write the code in windows. But my server is in linux.
How shall I proceed?
Thanks in advance |
How to become productive using Vim/Emacs | 8,001,512 | 3 | 6 | 1,355 | 0 | python,ruby,linux,vim,emacs | I am an Emacs guy (using vi only to edit configuration files under /etc). I think that with Emacs, you should start it at most daily (and it is very different with vim), and you should configure it in your .emacs file. For example, I compile using the F12 key, with (global-set-key [f12] 'recompile) in my .emacs. | 0 | 1 | 0 | 1 | 2011-11-03T20:24:00.000 | 5 | 0.119427 | false | 8,001,384 | 0 | 0 | 1 | 3 | I've been an Eclipse user for the last 3 years or more. I do Java EE (and Spring) development in it and so far I've done 90% of my tasks without having to touch the mouse. Typically my Eclipse setup is as follow:
Subclipse (or alternatively I use command line)
m2clipse (Maven Eclipse plugin)
Data Source Explorer (de... |
How to become productive using Vim/Emacs | 8,001,471 | 5 | 6 | 1,355 | 0 | python,ruby,linux,vim,emacs | If you ask a question which involves "vim OR emacs" you will never get an useful answer. It's a religious question, which does not have a correct answer! That said, you should clearly use Vim! ;-)
But seriously: Vim is much more lightweight, so it might better suite the scenario you are describing. Vim can be scripted ... | 0 | 1 | 0 | 1 | 2011-11-03T20:24:00.000 | 5 | 0.197375 | false | 8,001,384 | 0 | 0 | 1 | 3 | I've been an Eclipse user for the last 3 years or more. I do Java EE (and Spring) development in it and so far I've done 90% of my tasks without having to touch the mouse. Typically my Eclipse setup is as follow:
Subclipse (or alternatively I use command line)
m2clipse (Maven Eclipse plugin)
Data Source Explorer (de... |
How to become productive using Vim/Emacs | 8,001,983 | 1 | 6 | 1,355 | 0 | python,ruby,linux,vim,emacs | Either of those text editors will have a learning curve. That being said I have successfully used emacs to do the following tasks that are in line w/ what you've asked:
Write PL/SQL and execute it on an oracle DB all from the editor.
Write, Compile, Run java.
Edit pom files.
Keep a pretty good TODO list in org mode.... | 0 | 1 | 0 | 1 | 2011-11-03T20:24:00.000 | 5 | 0.039979 | false | 8,001,384 | 0 | 0 | 1 | 3 | I've been an Eclipse user for the last 3 years or more. I do Java EE (and Spring) development in it and so far I've done 90% of my tasks without having to touch the mouse. Typically my Eclipse setup is as follow:
Subclipse (or alternatively I use command line)
m2clipse (Maven Eclipse plugin)
Data Source Explorer (de... |
Errors trying to run a python script from a batch file | 8,002,349 | 2 | 2 | 579 | 0 | python,batch-file | Absolutely. If there's a space in the path, you need to put the whole path in double quotes. | 0 | 1 | 0 | 0 | 2011-11-03T21:43:00.000 | 1 | 0.379949 | false | 8,002,282 | 0 | 0 | 0 | 1 | I have this line in my bat file:
C:\Python26\python.exe C:\myPythonDirectory.py
But it fails giving the error: can't open file [Errno2] no such file or directory.
Could it be giving an error because there is a space in one of the folder names in my python directory? |
Install error easy_install python | 8,020,986 | 2 | 4 | 7,877 | 0 | python,windows,easy-install | easy_install is an executable program, not a Python script. Run it from the Windows command line, not from Python. | 0 | 1 | 0 | 0 | 2011-11-05T14:09:00.000 | 3 | 0.132549 | false | 8,020,673 | 1 | 0 | 0 | 1 | I use Windows 7 and Python IDLE.
I'm trying to use easy_install but gut this error:
Traceback (most recent call last): File "", line 1, in
easy_install NameError: name 'easy_install' is not defined
In included in my 'Path' the directory where it has been installed (C:\Python27\Scripts).
Any thoughts on wha... |
nohup not logging in nohup.out | 10,672,167 | 3 | 0 | 1,610 | 0 | python,logging,web2py,nohup | Nothing to worry. Actually the python process along with nohup was logging the file in batch mode and i could see the output only after quite some time and not instantaneously. | 0 | 1 | 0 | 0 | 2011-11-05T16:50:00.000 | 4 | 1.2 | true | 8,021,674 | 0 | 0 | 1 | 3 | I am running a python script of web2py and want to log its output. I am using following command
nohup python /var/www/web2py/web2py.py -S cloud -M -N -R applications/cloud/private/process.py >>/var/log/web2pyserver.log 2>&1 &
The process is running but it is not logging into the file. I have tried without nohup also bu... |
nohup not logging in nohup.out | 12,594,155 | 0 | 0 | 1,610 | 0 | python,logging,web2py,nohup | If you've got commas in your print statements there's a good chance it's due to buffering. You can put a sys command (forget which) in your code or when you run the nohup, just add the option -u and you'll disable std(in|out|err) buffering | 0 | 1 | 0 | 0 | 2011-11-05T16:50:00.000 | 4 | 0 | false | 8,021,674 | 0 | 0 | 1 | 3 | I am running a python script of web2py and want to log its output. I am using following command
nohup python /var/www/web2py/web2py.py -S cloud -M -N -R applications/cloud/private/process.py >>/var/log/web2pyserver.log 2>&1 &
The process is running but it is not logging into the file. I have tried without nohup also bu... |
nohup not logging in nohup.out | 8,022,039 | 0 | 0 | 1,610 | 0 | python,logging,web2py,nohup | nohup will try to create the file in the local directory. Can you create a file in the folder you are running it from ? | 0 | 1 | 0 | 0 | 2011-11-05T16:50:00.000 | 4 | 0 | false | 8,021,674 | 0 | 0 | 1 | 3 | I am running a python script of web2py and want to log its output. I am using following command
nohup python /var/www/web2py/web2py.py -S cloud -M -N -R applications/cloud/private/process.py >>/var/log/web2pyserver.log 2>&1 &
The process is running but it is not logging into the file. I have tried without nohup also bu... |
How to write to log in python with nginx + uwsgi | 8,022,616 | 4 | 8 | 11,471 | 0 | python,logging,nginx,uwsgi | use logging.StreamHandler as logging handler | 0 | 1 | 0 | 1 | 2011-11-05T18:58:00.000 | 2 | 1.2 | true | 8,022,495 | 0 | 0 | 0 | 2 | I have a server running nginx + UWSGI + python. UWSGI is running as a daemon with the flag set: --daemonize /var/log/uwsgi.log which logs all application errors.
I've noticed that on error if I use a python print statement it will write to the log but only on an error. The standard python logging library doesn't seem t... |
How to write to log in python with nginx + uwsgi | 8,022,729 | 5 | 8 | 11,471 | 0 | python,logging,nginx,uwsgi | uWSGI is a wsgi server, and as such passes a stream in the environ dict passed to the application callable it hosts, using the key wsgi.errors. If you are writing a bare wsgi app, then writing to that stream should do the job. If you are using a framework that abstracts the wsgi interface out (and by the sound of it,... | 0 | 1 | 0 | 1 | 2011-11-05T18:58:00.000 | 2 | 0.462117 | false | 8,022,495 | 0 | 0 | 0 | 2 | I have a server running nginx + UWSGI + python. UWSGI is running as a daemon with the flag set: --daemonize /var/log/uwsgi.log which logs all application errors.
I've noticed that on error if I use a python print statement it will write to the log but only on an error. The standard python logging library doesn't seem t... |
Datastore 'Response too large error' since migrated to Python27 | 8,034,730 | 3 | 4 | 190 | 0 | python,google-app-engine | This is a known bug in the Python 2.7 runtime - if the result of a datastore query is >1MB then you will get this response.
It will be fixed in 1.6.1. | 0 | 1 | 0 | 0 | 2011-11-06T01:24:00.000 | 1 | 1.2 | true | 8,024,609 | 0 | 0 | 1 | 1 | I just migrated my GAE/python app from M/S to HRD and then activated the new python27 runtime.
Now most of my datastore queries are failing with this error:
ResponseTooLargeError: The response from API call datastore_v3.RunQuery() was too large.
The same code is still running on older GAE app (M/S and python25) with no... |
Resource usage of google Go vs Python and Java on Appengine | 8,038,951 | 23 | 53 | 12,094 | 0 | java,python,google-app-engine,go | The cost of instances is only part of the cost of your app. I only use the Java runtime right now, so I don't know how much more or less efficient things would be with Python or Go, but I don't imagine it will be orders of magnitude different. I do know that instances are not the only cost you need to consider. Depe... | 0 | 1 | 0 | 0 | 2011-11-07T14:26:00.000 | 5 | 1 | false | 8,037,783 | 0 | 0 | 1 | 4 | Will google Go use less resources than Python and Java on Appengine? Are the instance startup times for go faster than Java's and Python's startup times?
Is the go program uploaded as binaries or source code and if it is uploaded as source code is it then compiled once or at each instance startup?
In other words: Will... |
Resource usage of google Go vs Python and Java on Appengine | 10,370,469 | 17 | 53 | 12,094 | 0 | java,python,google-app-engine,go | The question is mostly irrelevant.
The minimum memory footprint for a Go app is less than a Python app which is less than a Java app. They all cost the same per-instance, so unless your application performs better with extra heap space, this issue is irrelevant.
Go startup time is less than Python startup time which i... | 0 | 1 | 0 | 0 | 2011-11-07T14:26:00.000 | 5 | 1 | false | 8,037,783 | 0 | 0 | 1 | 4 | Will google Go use less resources than Python and Java on Appengine? Are the instance startup times for go faster than Java's and Python's startup times?
Is the go program uploaded as binaries or source code and if it is uploaded as source code is it then compiled once or at each instance startup?
In other words: Will... |
Resource usage of google Go vs Python and Java on Appengine | 10,283,180 | 47 | 53 | 12,094 | 0 | java,python,google-app-engine,go | Will google Go use less resources than Python and Java on Appengine?
Are the instance startup times for go faster than Java's and Python's
startup times?
Yes, Go instances have a lower memory than Python and Java (< 10 MB).
Yes, Go instances start faster than Java and Python equivalent because the runtime only nee... | 0 | 1 | 0 | 0 | 2011-11-07T14:26:00.000 | 5 | 1 | false | 8,037,783 | 0 | 0 | 1 | 4 | Will google Go use less resources than Python and Java on Appengine? Are the instance startup times for go faster than Java's and Python's startup times?
Is the go program uploaded as binaries or source code and if it is uploaded as source code is it then compiled once or at each instance startup?
In other words: Will... |
Resource usage of google Go vs Python and Java on Appengine | 8,044,755 | 0 | 53 | 12,094 | 0 | java,python,google-app-engine,go | I haven't used Go, but I would strongly suspect it would load and execute instances much faster, and use less memory purely because it is compiled. Anecdotally from the group, I believe that Python is more responsive than Java, at least in instance startup time.
Instance load/startup times are important because when y... | 0 | 1 | 0 | 0 | 2011-11-07T14:26:00.000 | 5 | 0 | false | 8,037,783 | 0 | 0 | 1 | 4 | Will google Go use less resources than Python and Java on Appengine? Are the instance startup times for go faster than Java's and Python's startup times?
Is the go program uploaded as binaries or source code and if it is uploaded as source code is it then compiled once or at each instance startup?
In other words: Will... |
How do I stop wxFileDialog running on OSX from treating .itlp packages as files? | 8,066,742 | 1 | 0 | 106 | 0 | wxpython | It sounds like you're trying to open a file with a file dialog. wxPython wraps the native widgets where ever possible, so I'm guessing it's behaving the same way that the normal file dialog does. Try opening the file with a different program that loads that dialog and it'll probably behave the same way. On Windows when... | 0 | 1 | 0 | 0 | 2011-11-09T13:58:00.000 | 1 | 1.2 | true | 8,066,075 | 0 | 0 | 0 | 1 | I'm working on a program for which I need to be able to open a zip file containing an itlp (iTunes LP) and then do stuff to it. I'm using wxFileDialog in wxPython for this purpose using the appropriate wildcard to only show zip files.
The problem is that because itlp's are folders not files they are still shown in t... |
Kill a python process | 20,572,635 | 0 | 17 | 59,787 | 0 | python,macos | Open Activity monitor, go to the Processes tab, and highlight python.exe and quit it by clicking Quit. | 0 | 1 | 0 | 0 | 2011-11-09T14:08:00.000 | 4 | 0 | false | 8,066,221 | 1 | 0 | 0 | 3 | I wrote a python script but accidentally put an infinite while loop in my script.
How do I kill the process? I've tried ctrl+c but with no success.
Are there any other option to try?
I'm on Mac Os X 10.7.2 with python 2.7 |
Kill a python process | 8,066,307 | 25 | 17 | 59,787 | 0 | python,macos | ps a to get the PID of your process. kill -9 <pid> to send it the unblockable SIGKILL signal.
Note that I only have a Linux box in front of me to test, so the OS X commands may be slightly different. | 0 | 1 | 0 | 0 | 2011-11-09T14:08:00.000 | 4 | 1.2 | true | 8,066,221 | 1 | 0 | 0 | 3 | I wrote a python script but accidentally put an infinite while loop in my script.
How do I kill the process? I've tried ctrl+c but with no success.
Are there any other option to try?
I'm on Mac Os X 10.7.2 with python 2.7 |
Kill a python process | 8,066,240 | 29 | 17 | 59,787 | 0 | python,macos | Try Ctrl+\ to send a SIGQUIT. | 0 | 1 | 0 | 0 | 2011-11-09T14:08:00.000 | 4 | 1 | false | 8,066,221 | 1 | 0 | 0 | 3 | I wrote a python script but accidentally put an infinite while loop in my script.
How do I kill the process? I've tried ctrl+c but with no success.
Are there any other option to try?
I'm on Mac Os X 10.7.2 with python 2.7 |
Connect appengine with cakephp | 8,070,747 | 0 | 0 | 378 | 1 | php,python,google-app-engine,cakephp | You can not run PHP on GAE. If you run PHP somewhere, it is a bad architecture to go over the internet for your data. It will be slooooow and a nightmare to develop in.
You should store your data where you run your php, unless you must have a distributed, globally scaling architecture, which afaiu not the case. | 0 | 1 | 0 | 0 | 2011-11-09T18:21:00.000 | 5 | 0 | false | 8,069,649 | 0 | 0 | 1 | 1 | I'm thinking in create a webapplication with cakephp but consuming python's appengine webservice. But, to install cakephp etc, I need to configure the database. Appengine uses another kind of datastorage, with is different from mysql, etc.
I was thinking in store the data in appengine, and using the python webservices,... |
How to compile .py into an executable for Debian | 8,072,665 | 0 | 1 | 2,610 | 0 | python,compilation,debian | Why do you think you need to compile it? Debian, like most other Linux distributions, comes with Python installed as standard, as many of the system tools depend on it. A Python script will just run. | 0 | 1 | 0 | 0 | 2011-11-09T22:10:00.000 | 3 | 0 | false | 8,072,461 | 0 | 0 | 0 | 1 | I'm having a hard time finding a conclusive answer for how to compile a Python 2.7 .py file into a executable program for Debian. Most tutorials say "we assume you've already written the manifest, etc.", but I cannot find how to do those first steps.
So, I need a step-by-step. How do I take JUST a .py file (using Pytho... |
Screen recorder in python | 8,074,644 | 1 | 5 | 14,740 | 0 | python,video | I know of no mechanism to perform screen recording in Python. However, you may be able to use Python to control one of the many existing screen recording programs:
recorditnow
recordmydesktop
byzanz
istanbul
vnc2swf
pyvnc2swf | 0 | 1 | 0 | 0 | 2011-11-10T03:16:00.000 | 3 | 0.066568 | false | 8,074,595 | 0 | 0 | 0 | 1 | Is there a library for making a screen recorder application in python? i think it would be fun to make somthing like that. but a library that will work on linux im using ubuntu
Thanks ! |
Cygwin paths for Windows python | 8,082,314 | 2 | 3 | 3,843 | 0 | python,cygwin | No, Windows python has no suport for Cygwin paths, but Cygwin does have its own Python. If you can't add that to the existing Cygwin install, you might want to consider doing a user-specific Cygwin install into a directory that you're allowed to write to.
There is a way to obtain limited Cygwin path support for Windows... | 0 | 1 | 0 | 0 | 2011-11-10T11:43:00.000 | 2 | 0.197375 | false | 8,078,967 | 1 | 0 | 0 | 1 | I have access to a machine with a minimal cygwin installation, and the Windows version of python. I need to run some python scripts there, however python requires Windows paths. I can use cygpath -w, on the arguments that I provide, however further unix/cygwin paths are included in numerous other scripts which are subs... |
Best way to fork multiple shell commands/processes in Python? | 8,090,108 | 3 | 3 | 4,562 | 0 | python,shell | All calls to subprocess.Popen return immediately to the caller. It's the calls to wait and communicate which block. So all you need to do is spin up a number of processes using subprocess.Popen (set stdin to /dev/null for safety), and then one by one call communicate until they're all complete.
Naturally I'm assuming y... | 0 | 1 | 0 | 0 | 2011-11-11T05:34:00.000 | 5 | 0.119427 | false | 8,090,084 | 1 | 0 | 0 | 1 | Most of the examples I've seen with os.fork and the subprocess/multiprocessing modules show how to fork a new instance of the calling python script or a chunk of python code. What would be the best way to spawn a set of arbitrary shell command concurrently?
I suppose, I could just use subprocess.call or one of the Pop... |
chmod - file permission on executable | 8,104,835 | 2 | 0 | 1,884 | 0 | python,permissions,executable,chmod | The permissions you can set on a file with chmod affect who can read from/write to/execute that file, not what privileges the process created by running that file has.
On Unix you could get some form of protection by playing with the file owner and the sticky bit, and having appropriate permissions on your filesystem, ... | 0 | 1 | 0 | 0 | 2011-11-12T13:45:00.000 | 3 | 1.2 | true | 8,104,811 | 0 | 0 | 0 | 2 | I have to change file permissions on an executable file, using os.chmod.
I have this executable and I want to change its permissions so that it can write nowhere, only reading and executing.
How can I do that?
Thanks,
rubik |
chmod - file permission on executable | 8,104,833 | 1 | 0 | 1,884 | 0 | python,permissions,executable,chmod | I have this executable and I want to change its permissions so that it can write nowhere, only reading and executing
That's not how chmod works - it sets permissions on the file itself, it can't restrict what an executable can write to. | 0 | 1 | 0 | 0 | 2011-11-12T13:45:00.000 | 3 | 0.066568 | false | 8,104,811 | 0 | 0 | 0 | 2 | I have to change file permissions on an executable file, using os.chmod.
I have this executable and I want to change its permissions so that it can write nowhere, only reading and executing.
How can I do that?
Thanks,
rubik |
ipython: %paste over ssh connection | 8,175,931 | 53 | 33 | 5,474 | 0 | ipython | I think this is exactly what %cpaste is for (I am always forgetting about all the things IPython does). %cpaste enters a state allowing you to paste already formatted or indented code, and it will strip leading indentation and prompts, so you can copy/paste indented code from files, or even from an interactive Python ... | 0 | 1 | 0 | 0 | 2011-11-12T20:16:00.000 | 2 | 1.2 | true | 8,107,261 | 0 | 0 | 0 | 1 | In ipython >=0.11, the %paste command is required to paste indented commands. However, if I run an ipython shell in a remote terminal, the buffer %paste refers to is on the remote machine rather than the local machine. Is there any way around this? |
different types of line terminations(unix, windows, etc) | 8,115,701 | 1 | 0 | 136 | 0 | python,termination,linefeed | You mostly don't need to worry about it. If you come to a point when something doesn't work, come back and ask about that.
Note however that what determines the line-ending convention is not which programming language you use, but the platform it runs on (*nix/Windows/Mac, all are different). | 0 | 1 | 0 | 0 | 2011-11-13T19:04:00.000 | 1 | 1.2 | true | 8,113,895 | 0 | 0 | 0 | 1 | I'm note sure about conventions for different types of line termination in different programming languages. I know that there are 2 types, 1: line feed, 2: carriage-return, line feed. My question is: how does readline in different programming languages, like python: a = fd.readline();, c/c++: file.getline (buffer,100);... |
Cross platform build script that can call MSBuild or Xbuild depending on environment? | 8,114,513 | 0 | 0 | 391 | 0 | c#,python,scripting,msbuild,mono | Far easier would be to write a small shell script for Linux or OSX that ran xbuild but was called msbuild. The arguments are the same I think. | 0 | 1 | 0 | 0 | 2011-11-13T19:31:00.000 | 1 | 0 | false | 8,114,067 | 1 | 0 | 0 | 1 | I have a simple .Net console app which has only framework dependencies. It can compile fine with either MSBuild on windows or Mono/XBuild on linux. It is part of a larger project, which has a python build script. Is there any simple way to determine the most suitable build engine (msbuild/xbuild) and use that?
In other... |
does Tornado uses WSGI to deal with python files? | 8,129,321 | 3 | 1 | 444 | 0 | python,wsgi,tornado | Tornado shouldn't use WSGI, because WSGI is not async friendly. It has WSGI support, but it won't support async.
Tornado has its own HTTP server (written in C and Python), and can be used standalone or placed behind another async HTTP server (usually Nginx). | 0 | 1 | 0 | 0 | 2011-11-14T21:56:00.000 | 1 | 1.2 | true | 8,128,736 | 0 | 0 | 1 | 1 | am sorry for that question,
am beginning in Tornado, and because i come from two other frameworks: Flask and Django, Flask uses Werkzeug which is a WSGI webserver, Django uses WSGI too, but, when making an application programmed with Tornado, how it will deal with HTTP? there is a protocol to deal with python files whe... |
Python: How do I redirect output of os.system to python shell? | 8,142,466 | 2 | 3 | 6,088 | 0 | python | (Reposting as an answer as requested):
os.system() will work when run in a terminal - that's where stdout is going, and any processes you start will inherit that stdout unless you redirect it.
If you need to redirect into IDLE, use @root45's answer above (upvoted). That will work for most programs, but at least on Unix... | 0 | 1 | 0 | 0 | 2011-11-15T17:45:00.000 | 2 | 1.2 | true | 8,140,750 | 0 | 0 | 0 | 1 | I want to make a simple batch script using python using os.system. I am able to run the commands just fine, but the output for those commands dont print to the python shell. Is there some way to redirect the output to the python shell? |
Redirecting traffic to other webserver | 8,166,815 | 2 | 1 | 388 | 0 | python,linux,redirect,webserver,transmission | I found my answer: a reverse proxy. It will take care of the routing to the correct port based on the URL. I now just have to select the right one there are so many (NginX, pound, lighttd etc...)
Thanks anyway. | 0 | 1 | 1 | 0 | 2011-11-16T09:57:00.000 | 2 | 0.197375 | false | 8,149,701 | 0 | 0 | 0 | 1 | Here is my setup: I have a Python webserver (written myself) that listens on port 80 and also have the Transmission-daemon (bittorrent client) that provides a webUI on port 9101. (running on Linux)
I can access both webservers locally without problems, but now would like to access them externally also. My issue is that... |
Ignore case in glob() on Linux | 42,831,010 | 1 | 48 | 34,246 | 0 | python,linux | Depending on your case, you might use .lower() on both file pattern and results from folder listing and only then compare the pattern with the filename | 0 | 1 | 0 | 0 | 2011-11-16T11:59:00.000 | 8 | 0.024995 | false | 8,151,300 | 0 | 0 | 0 | 1 | I'm writing a script which will have to work on directories which are modified by hand by Windows and Linux users alike. The Windows users tend to not care at all about case in assigning filenames.
Is there a way to handle this on the Linux side in Python, i.e. can I get a case-insensitive, glob-like behaviour? |
Looking for algorithm to help determine shortest path from one terminal screen to another | 8,154,303 | 0 | 0 | 137 | 0 | python,graph-algorithm | If you have created a topology of the screens, the A* algorithm should work fine. | 0 | 1 | 0 | 0 | 2011-11-16T14:46:00.000 | 2 | 0 | false | 8,153,525 | 0 | 0 | 0 | 1 | I am using a terminal client to interact with a mainframe computer. The entire interface is based on the concept of screens. An example workflow might look like:
Login Screen: enter login credentials, press enter
Menu Screen: enter the number of the menu item you want (lets say "6" for memos), press enter
Memo Scree... |
Alternative to TCP/IP for local program-to-program data streaming? | 8,157,428 | 8 | 2 | 856 | 0 | c++,python,linux,networking,gcc | If you already have a TCP or UDP server, the easiest way will probably be to switch to UNIX domain sockets.
They come in "stream" and "datagram" modes, just like TCP/UDP sockets, and they're always local, as they use the filesystem namespace (instead of port numbers like TCP/UDP). | 0 | 1 | 0 | 0 | 2011-11-16T19:16:00.000 | 4 | 1.2 | true | 8,157,348 | 0 | 0 | 0 | 2 | I have a GNU C++ program and a python script that need to pass strings to each other quite frequently (~70-80 messages a minute). They will run local to each other in CentOS (hosted in the same environment). It feels that although TCP/IP can and will get the job done, what other options do I have?
Keep in mind that I c... |
Alternative to TCP/IP for local program-to-program data streaming? | 8,157,381 | 0 | 2 | 856 | 0 | c++,python,linux,networking,gcc | Maybe you can use named pipes? | 0 | 1 | 0 | 0 | 2011-11-16T19:16:00.000 | 4 | 0 | false | 8,157,348 | 0 | 0 | 0 | 2 | I have a GNU C++ program and a python script that need to pass strings to each other quite frequently (~70-80 messages a minute). They will run local to each other in CentOS (hosted in the same environment). It feels that although TCP/IP can and will get the job done, what other options do I have?
Keep in mind that I c... |
Separated web server and application server? | 8,163,446 | 3 | 2 | 265 | 0 | python,apache,wsgi | WSGI is not a network protocol, so you will have to run a web server in front of your application even if it only acts as a WSGI container. Proxy connections from your main web server to the WSGI container with mod_proxy. | 0 | 1 | 0 | 0 | 2011-11-17T07:19:00.000 | 2 | 0.291313 | false | 8,163,418 | 0 | 0 | 1 | 2 | I am developing web service. My system is like this:
Client request --> Web Server(Apache) --> Application Server(Python)
I used WSGI for communicating between Apache and Python.
My question how can I separated the web server and app server. At the moment, I have to run them on the same server. |
Separated web server and application server? | 8,163,634 | 1 | 2 | 265 | 0 | python,apache,wsgi | +1 for Ignacio's answer.
Also note that separating a WSGI app from a server will lose one of the main benefits of WSGI (the server calls the wsgi app directly). Additionally, WSGI apps have a response callback that was intended to communicate directly with the server.
Instead of decoupling the server from the app, ... | 0 | 1 | 0 | 0 | 2011-11-17T07:19:00.000 | 2 | 0.099668 | false | 8,163,418 | 0 | 0 | 1 | 2 | I am developing web service. My system is like this:
Client request --> Web Server(Apache) --> Application Server(Python)
I used WSGI for communicating between Apache and Python.
My question how can I separated the web server and app server. At the moment, I have to run them on the same server. |
Run the some code whenever I upload the project on to the app engine server | 8,163,809 | 0 | 2 | 64 | 0 | python,google-app-engine,appserver | There isn't an official way to discover if your application has been modified altought each time you upload your application it gets a unique version number {app version.(some unique number)} but since there isn't a document API on how to get it I wound't take a risk and use it.
What you need todo is to have a script t... | 0 | 1 | 0 | 0 | 2011-11-17T07:47:00.000 | 1 | 0 | false | 8,163,669 | 0 | 0 | 1 | 1 | I've built an appeninge project so, how can I run some piece of code on the appserver only once, i.e when ever I upload the whole project on to the server.
How should I achieve this task??? |
How to speed up debugging of python programs in PyDev in Eclipse (esspecially Google App Engine) | 8,169,698 | 0 | 0 | 291 | 0 | python,debugging,google-app-engine,optimization,pydev | How often do you need to reload the application?, the dev server will update all your code and configuration changes without need to reload. | 0 | 1 | 0 | 1 | 2011-11-17T15:18:00.000 | 1 | 0 | false | 8,169,561 | 0 | 0 | 1 | 1 | How it possible to speed up debugging in PyDev in Eclipse for Google App Engine programs?
How to speed up code execution?
How to speed up application reloading?
Please share your experience or suggestions. |
How to run invisible subprocess in Python? | 8,176,549 | 5 | 1 | 1,893 | 0 | python,process,subprocess | Not without getting into subversive process hiding tasks.
If as a user that wants to look at the running processes, let me see the running processes. Don't hide it from me.
Techniques to hide running processes may also be picked up by some anti virus as potential threats.
Don't do it.
Actually, why do you want to? I ... | 0 | 1 | 0 | 0 | 2011-11-18T00:45:00.000 | 2 | 0.462117 | false | 8,176,421 | 1 | 0 | 0 | 2 | I would like to know if it's possible to run Python application subprocess in such way that there wouldn't be duplicate process in task manager? |
How to run invisible subprocess in Python? | 8,176,846 | 0 | 1 | 1,893 | 0 | python,process,subprocess | Are you sure this "subprocess" needs to actually be a process? Maybe you could do the work inside of a thread instead of forking a new process. I'm not sure if that would accomplish your goals though, since you're not specific about what you need multiple processes for. | 0 | 1 | 0 | 0 | 2011-11-18T00:45:00.000 | 2 | 0 | false | 8,176,421 | 1 | 0 | 0 | 2 | I would like to know if it's possible to run Python application subprocess in such way that there wouldn't be duplicate process in task manager? |
How can I delete the automatic Indexes in App Engine? | 8,186,860 | 3 | 2 | 185 | 0 | python,google-app-engine,google-cloud-datastore | vacuum_indexes is only for indexes defined in index.yaml, for automatic index its enough to set indexed = False and uploaded a new version.
You can see the impact of setting indexed to False in the development server datastore page in the write counts column. | 0 | 1 | 0 | 0 | 2011-11-18T16:45:00.000 | 2 | 1.2 | true | 8,185,834 | 0 | 0 | 1 | 2 | So I have a live Python application on App Engine that has far too many automatic indexes. I noticed a high amount of datastore writes for my low entity count and I believe this is the cause. Each entity has many StringProperties and some even have StringListProperties.
I added the indexed = False to all my object's pr... |
How can I delete the automatic Indexes in App Engine? | 8,189,761 | 1 | 2 | 185 | 0 | python,google-app-engine,google-cloud-datastore | To get rid of the existing automatic indices you will have to retrieve every single entity and re-put it with the indexed = False properties.
If you don't do this, then the automatic indices will stick around. However, the new entities you create will not be added to those indices. | 0 | 1 | 0 | 0 | 2011-11-18T16:45:00.000 | 2 | 0.099668 | false | 8,185,834 | 0 | 0 | 1 | 2 | So I have a live Python application on App Engine that has far too many automatic indexes. I noticed a high amount of datastore writes for my low entity count and I believe this is the cause. Each entity has many StringProperties and some even have StringListProperties.
I added the indexed = False to all my object's pr... |
How to execute a series of Python scripts in batch? | 8,187,496 | 6 | 2 | 2,093 | 0 | python,batch-file | Refactor them into modules, then make a new script that imports the relevant functions from each module and runs those.
The easiest way to do this is to write a main function per module and run all the main function serially. | 0 | 1 | 0 | 0 | 2011-11-18T18:43:00.000 | 2 | 1.2 | true | 8,187,461 | 1 | 0 | 0 | 1 | I frequently find that I need to run a series of python scripts sequentially. The order and number of these scripts may vary, but instead of executing each script individually and sequentially, is there a preferred way of batch automating a series of Python scripts? My programs require multiple and complex file path an... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.