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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
appengine and no-ip.org | 1,480,797 | 1 | 0 | 875 | 0 | python,google-app-engine,dns,subdomain | You can't do this, because you don't own no-ip.org. In order to use a domain with App Engine, you have to set up Google Apps on the domain, and in order to do that, you must own the domain.
As mentioned in the comments, buying your own domain is your best option. | 0 | 1 | 0 | 0 | 2009-09-23T12:47:00.000 | 5 | 0.039979 | false | 1,465,769 | 0 | 0 | 1 | 1 | I'd like to run an appengine app on a subdomain
like something.no-ip.org instead of something.appspot.com
is this doable? If so, can you please help me understand? :)
Thank you so much for your help! |
Cross-platform help viewer with search functionality | 1,809,732 | 1 | 0 | 231 | 0 | python,documentation,cross-platform,chm | wxHtmlHelpController doesn't support any scripting within pages, nor does it support css. | 0 | 1 | 0 | 0 | 2009-09-23T20:20:00.000 | 2 | 0.099668 | false | 1,468,314 | 0 | 0 | 1 | 1 | I am looking for a help viewer like Windows CHM that basically provides support for
adding content in HTML format
define Table of Contents
decent search
It should work on Windows, Mac and Linux. Bonus points for also having support for generating a "plain HTML/javascript" version that can be viewed in any browser (a... |
Time difference between system date and string, e.g. from directory name? | 1,487,702 | 1 | 0 | 289 | 0 | python,date,scripting | I would suggest using Python. You'll need the following functions:
os.listdir gives you the directory contents, as a list of strings
time.strptime(name, "%d-%m-%y") will try to parse such a string, and return a time tuple. You get a ValueError exception if parsing fails.
time.mktime will convert a time tuple into seco... | 0 | 1 | 0 | 1 | 2009-09-28T14:45:00.000 | 1 | 1.2 | true | 1,487,450 | 0 | 0 | 0 | 1 | I would like to write a small script that does the following (and that I can then run using my crontab):
Look into a directory that contains directories whose names are in some date format, e.g. 30-10-09.
Convert the directory name to the date it represents (of course, I could put this information as a string into a f... |
How do I find out my PYTHONPATH using Python? | 62,773,911 | 0 | 447 | 822,516 | 0 | python,python-module,pythonpath | If using conda, you can get the env prefix using os.environ["CONDA_PREFIX"]. | 0 | 1 | 0 | 1 | 2009-09-28T22:01:00.000 | 10 | 0 | false | 1,489,599 | 1 | 0 | 0 | 1 | How do I find out which directories are listed in my system’s PYTHONPATH variable, from within a Python script (or the interactive shell)? |
Embeddable Workflow/BPM Library For Python? | 1,493,731 | 3 | 7 | 9,645 | 0 | python,workflow,business-process-management | Oh yes, tons. But most of them depend on a specific framework. DCWorkflow is integrated with Zopes CMF, for example. hurry.workflow is for Zope 3, etc. SpiffWorkflow presumes sql-alchemy, etc. This is because you need to have something to apply the workflow to, and that means you need to make some basic assumptions on ... | 0 | 1 | 0 | 0 | 2009-09-29T16:12:00.000 | 2 | 1.2 | true | 1,493,550 | 0 | 0 | 0 | 1 | Let's say you are building a Python-based web app that requires some workflow management such as that in jBPM or Windows Workflow Foundation. Is there a library that offers this in the Python world? |
how to obtain physical drives in Windows | 1,497,789 | 1 | 2 | 5,364 | 0 | python,windows | Also you can try win32 module for Python. | 0 | 1 | 0 | 0 | 2009-09-30T08:47:00.000 | 4 | 0.049958 | false | 1,496,842 | 0 | 0 | 0 | 1 | I'm programming in Python with a wrapper of the kernel32 dll, so I can use any functions of this dll, like GetLogicalDrives(), for instance. I'm trying to obtain the information of the physical drives, even if they are not mounted. I've seen a question similar to this, but I need the information of the not mounted driv... |
Performance of Python worth the cost? | 1,498,739 | 5 | 5 | 1,593 | 0 | python,c,embedded,fuzzy-logic | Make it work, then make it work fast. | 0 | 1 | 0 | 1 | 2009-09-30T13:32:00.000 | 6 | 0.16514 | false | 1,498,155 | 0 | 0 | 0 | 6 | I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries.
I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM).
The main concern is that re... |
Performance of Python worth the cost? | 1,499,253 | 1 | 5 | 1,593 | 0 | python,c,embedded,fuzzy-logic | If most of your runtime is spent in C libraries, the language you use to call these libraries isn't important. What language are your time-eating libraries written in ? | 0 | 1 | 0 | 1 | 2009-09-30T13:32:00.000 | 6 | 0.033321 | false | 1,498,155 | 0 | 0 | 0 | 6 | I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries.
I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM).
The main concern is that re... |
Performance of Python worth the cost? | 1,502,231 | 0 | 5 | 1,593 | 0 | python,c,embedded,fuzzy-logic | From your description, speed should not be much of a concern (and you can use C, cython, whatever you want to make it faster), but memory would be. For environments with 64 Mb max (where the OS and all should fit as well, right ?), I think there is a good chance that python may not be the right tool for target deploym... | 0 | 1 | 0 | 1 | 2009-09-30T13:32:00.000 | 6 | 0 | false | 1,498,155 | 0 | 0 | 0 | 6 | I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries.
I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM).
The main concern is that re... |
Performance of Python worth the cost? | 1,612,690 | 0 | 5 | 1,593 | 0 | python,c,embedded,fuzzy-logic | I never really measured the performance of pyfuzzy's examples, but as the new version 0.1.0 can read FCL files as FFLL does. Just describe your fuzzy system in this format, write some wrappers, and check the performance of both variants.
For reading FCL with pyfuzzy you need the antlr python runtime, but after reading ... | 0 | 1 | 0 | 1 | 2009-09-30T13:32:00.000 | 6 | 0 | false | 1,498,155 | 0 | 0 | 0 | 6 | I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries.
I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM).
The main concern is that re... |
Performance of Python worth the cost? | 1,498,214 | 35 | 5 | 1,593 | 0 | python,c,embedded,fuzzy-logic | In general, you shouldn't obsess over performance until you've actually seen it become a problem. Since we don't know the details of your app, we can't say how it'd perform if implemented in Python. And since you haven't implemented it yet, neither can you.
Implement the version you're most comfortable with, and can im... | 0 | 1 | 0 | 1 | 2009-09-30T13:32:00.000 | 6 | 1.2 | true | 1,498,155 | 0 | 0 | 0 | 6 | I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries.
I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM).
The main concern is that re... |
Performance of Python worth the cost? | 1,498,176 | 12 | 5 | 1,593 | 0 | python,c,embedded,fuzzy-logic | Python is very slow at handling large amounts of non-string data. For some operations, you may see that it is 1000 times slower than C/C++, so yes, you should investigate into this and do necessary benchmarks before you make time-critical algorithms in Python.
However, you can extend python with modules in C/C++ code, ... | 0 | 1 | 0 | 1 | 2009-09-30T13:32:00.000 | 6 | 1 | false | 1,498,155 | 0 | 0 | 0 | 6 | I'm looking at implementing a fuzzy logic controller based on either PyFuzzy (Python) or FFLL (C++) libraries.
I'd prefer to work with python but am unsure if the performance will be acceptable in the embedded environment it will work in (either ARM or embedded x86 proc both ~64Mbs of RAM).
The main concern is that re... |
Running python script as another user | 1,499,282 | -1 | 14 | 33,209 | 0 | python,linux | Use the command sudo.
In order to run a program as a user, the system must "authenticate" that user.
Obviously, root can run any program as any user, and any user can su to another user with a password.
The program sudo can be configured to allow a group of users to sudo a particular command as a particular user.
For e... | 0 | 1 | 0 | 1 | 2009-09-30T16:31:00.000 | 3 | -0.066568 | false | 1,499,268 | 0 | 0 | 0 | 2 | On a Linux box I want to run a Python script as another user.
I've already made a wrapper program in C++ that calls the script, since I've realized that the ownership of running the script is decided by the ownership of the python interpreter. After that I change the C++ program to a different user and run the C++ prog... |
Running python script as another user | 1,499,313 | 0 | 14 | 33,209 | 0 | python,linux | Give those users the ability to sudo su $dedicated_username and tailor the permissions on your system so that $dedicated_user has sufficient, but not excessive, access. | 0 | 1 | 0 | 1 | 2009-09-30T16:31:00.000 | 3 | 0 | false | 1,499,268 | 0 | 0 | 0 | 2 | On a Linux box I want to run a Python script as another user.
I've already made a wrapper program in C++ that calls the script, since I've realized that the ownership of running the script is decided by the ownership of the python interpreter. After that I change the C++ program to a different user and run the C++ prog... |
With multiple Python installs, how does MacPorts know which one to install MySQLdb for? | 2,302,542 | 1 | 0 | 1,051 | 1 | python,mysql,macos | You also need python_select (or is it select_python?) to change the default python used. | 0 | 1 | 0 | 0 | 2009-09-30T17:32:00.000 | 2 | 0.099668 | false | 1,499,572 | 0 | 0 | 0 | 1 | I just upgraded the default Python 2.5 on Leopard to 2.6 via the installer on www.python.org. Upon doing so, the MySQLdb I had installed was no longer found. So I tried reinstalling it via port install py-mysql, and it succeeded, but MySQLdb was still not importable. So then I tried to python install python26 with pyth... |
Run a task every hour on the hour with App Engine's cron API | 1,501,925 | -1 | 4 | 3,297 | 0 | python,google-app-engine,cron | Looking over the docs, I agree that your 24 cron entry idea is the only documented way that would work. Not ideal, but should work. | 0 | 1 | 0 | 0 | 2009-10-01T04:36:00.000 | 4 | -0.049958 | false | 1,501,907 | 0 | 0 | 1 | 2 | I need to run a task every hour on the hour (00:00, 01:00, 02:00, ..., 23:00) every day of the week, but can't seem to find an example in App Engine's docs of how to do this.
There is an example of running at ask every hour, but this doesn't fit because the "start" of that hour depends on when you deploy the applicatio... |
Run a task every hour on the hour with App Engine's cron API | 1,501,960 | 1 | 4 | 3,297 | 0 | python,google-app-engine,cron | The docs say you can have 20 cron entries, so you can't have one for every hour of the day.
You could run your task every minute and check if it is the first minute of the hour - exit otherwise. | 0 | 1 | 0 | 0 | 2009-10-01T04:36:00.000 | 4 | 0.049958 | false | 1,501,907 | 0 | 0 | 1 | 2 | I need to run a task every hour on the hour (00:00, 01:00, 02:00, ..., 23:00) every day of the week, but can't seem to find an example in App Engine's docs of how to do this.
There is an example of running at ask every hour, but this doesn't fit because the "start" of that hour depends on when you deploy the applicatio... |
Using CherryPy as a blocking/non-threading server for easier debugging | 1,502,612 | 3 | 1 | 934 | 0 | python,debugging,cherrypy | No. Not only does the wsgiserver start its own set of worker threads (10 by default, but even if you only specified 1 that's still 1 thread for the listening socket and 1 worker thread). Even if that were not true, if you use the rest of CherryPy (i.e. the engine), it runs that 1 listener thread in a separate thread fr... | 0 | 1 | 0 | 0 | 2009-10-01T07:37:00.000 | 1 | 0.53705 | false | 1,502,431 | 1 | 0 | 0 | 1 | Is it possible to use the CherrPy server as a blocking/non-threading server (for easier debugging?) |
Network programming abstraction, decomposition | 1,506,213 | 0 | 0 | 290 | 0 | python,networking,network-programming,twisted | Why not use a database instead of "just a structure"? Both relational and non-relational DBs offer many practical advantages (separate processes using them, take care of replication [[and/or snapshots, backups, ...]], rich functionality if you need it for the "queries", and so on, and so forth).
Worst case, the "just ... | 0 | 1 | 0 | 0 | 2009-10-01T18:45:00.000 | 3 | 0 | false | 1,505,744 | 0 | 0 | 1 | 1 | I have a problem as follows:
Server process 1
Constantly sends updates that occur to a datastore
Server process 2
Clients contact the server, which queries the datastore, and returns a result
The thing is, the results that process 1 and process 2 are sending back the client are totally different and unrelated.
How ... |
can't install lxml (python 2.6.3, osx 10.6 snow leopard) | 1,513,810 | 3 | 4 | 2,271 | 0 | python,macos,port,osx-leopard,lxml | Ned :
incompatible changes in the 2.6.3 version of python's distutil
Not precisely. The API hasn't changed but Setuptools overrides them, and makes the assumption they are called in a particular order.
Lennart:
The Distribute installation doesn't seem to trigger the bug
Yes indeed, this precise bug was detected som... | 0 | 1 | 0 | 0 | 2009-10-03T01:33:00.000 | 2 | 0.291313 | false | 1,512,530 | 1 | 0 | 0 | 1 | I try to:
easy_install lxml
and I get this error:
File "build/bdist.macosx-10.3-fat/egg/setuptools/command/build_ext.py", line 85, in get_ext_filename
KeyError: 'etree'
any hints? |
Deploying a web service to my Google App Engine application | 1,514,062 | 1 | 0 | 369 | 0 | iphone,python,web-services,google-app-engine | Looks like you're not setting the Content-Type header correctly in your service (assuming you ARE actually trying to send XML -- e.g. SOAP, XML-RPC, &c). What code are you using to set that header? Without some indication about what protocol you're implementing and via what framework, it's impossible to help in detail... | 0 | 1 | 0 | 0 | 2009-10-03T07:04:00.000 | 2 | 0.099668 | false | 1,513,038 | 0 | 0 | 1 | 2 | We made a simple application and using GoogleAppEngineLauncher (GAEL) ran that locally. Then we deployed, using GAEL again, to our appid. It works fine.
Now, we made a web service. We ran that locally using GAEL and a very thin local python client. It works fine.
We deployed that, and we get this message when we try t... |
Deploying a web service to my Google App Engine application | 1,604,138 | 0 | 0 | 369 | 0 | iphone,python,web-services,google-app-engine | Looks like we aren't going to get to the bottom of this one. Just not enough information available at debug time. We've managed to affect a fix on the service, although I hate ot admit it we never found out what was causing this bug. | 0 | 1 | 0 | 0 | 2009-10-03T07:04:00.000 | 2 | 1.2 | true | 1,513,038 | 0 | 0 | 1 | 2 | We made a simple application and using GoogleAppEngineLauncher (GAEL) ran that locally. Then we deployed, using GAEL again, to our appid. It works fine.
Now, we made a web service. We ran that locally using GAEL and a very thin local python client. It works fine.
We deployed that, and we get this message when we try t... |
How can I detect when a flash drive is plugged in under Linux? | 1,518,829 | 1 | 5 | 6,498 | 0 | python,linux | When an USB device is plugged in syslog writes messages concerning this to /var/log/messages. The "dmesg" command shows this log. You can check near the end of the log to see which channel the device was attached to, it is usually /dev/sd(letter)(number) depending on the partitions and number of serial disks plugged i... | 0 | 1 | 0 | 0 | 2009-10-05T07:40:00.000 | 6 | 0.033321 | false | 1,518,699 | 0 | 0 | 0 | 3 | How can I detect when a flash drive is plugged in? I'm using a bare Debian installation, without any GUI and want to be notified in my Python script when a new flash drive appears... I know that D-BUS distributes such information, but i dont want to use D-BUS. Is there a more bare access to that information? Shouldn't ... |
How can I detect when a flash drive is plugged in under Linux? | 16,370,716 | 0 | 5 | 6,498 | 0 | python,linux | I did this using zenity in a script and udev with rule on rhel6 with:
KERNEL=="sd[b-d]", DRIVERS=="usb", ACTION=="add", RUN+="/path/to/script" | 0 | 1 | 0 | 0 | 2009-10-05T07:40:00.000 | 6 | 0 | false | 1,518,699 | 0 | 0 | 0 | 3 | How can I detect when a flash drive is plugged in? I'm using a bare Debian installation, without any GUI and want to be notified in my Python script when a new flash drive appears... I know that D-BUS distributes such information, but i dont want to use D-BUS. Is there a more bare access to that information? Shouldn't ... |
How can I detect when a flash drive is plugged in under Linux? | 1,518,728 | 0 | 5 | 6,498 | 0 | python,linux | /proc/partitions shows all the partitions known to the kernel. | 0 | 1 | 0 | 0 | 2009-10-05T07:40:00.000 | 6 | 0 | false | 1,518,699 | 0 | 0 | 0 | 3 | How can I detect when a flash drive is plugged in? I'm using a bare Debian installation, without any GUI and want to be notified in my Python script when a new flash drive appears... I know that D-BUS distributes such information, but i dont want to use D-BUS. Is there a more bare access to that information? Shouldn't ... |
Basic Comet in Python using just std lib | 1,751,708 | 0 | 1 | 719 | 0 | python,comet | Extending what lost-theory has said, if you want to use comet for a passing messages between clients then you need to implement something like pubsub.
Using something like tornado for the pubsub is much simpler than with the single threaded wsgiref servers. | 0 | 1 | 0 | 0 | 2009-10-05T16:04:00.000 | 3 | 0 | false | 1,520,953 | 0 | 0 | 1 | 2 | I'm developing a web interface for an already existing desktop application. I've been looking for a way to allow the server to push content to the browser and ended up reaching Comet.
Navigating through the internet, and most of the questions here, I got answers like twisted, orbited, tornado and most of them even poin... |
Basic Comet in Python using just std lib | 1,520,980 | 0 | 1 | 719 | 0 | python,comet | This is possible. Just don't close the connection to the client. | 0 | 1 | 0 | 0 | 2009-10-05T16:04:00.000 | 3 | 0 | false | 1,520,953 | 0 | 0 | 1 | 2 | I'm developing a web interface for an already existing desktop application. I've been looking for a way to allow the server to push content to the browser and ended up reaching Comet.
Navigating through the internet, and most of the questions here, I got answers like twisted, orbited, tornado and most of them even poin... |
Werkzeug in General, and in Python 3.1 | 1,622,505 | 1 | 2 | 2,259 | 1 | python,python-3.x,werkzeug | I can only answer question one:
I started using it for some small webstuff but now moved on to rework larger apps with it. Why Werkzeug? The modular concept is really helpful. You can hook in modules as you like, make stuff easily context aware and you get good request file handling for free which is able to cope with ... | 0 | 1 | 0 | 0 | 2009-10-06T05:13:00.000 | 3 | 0.066568 | false | 1,523,706 | 0 | 0 | 1 | 3 | I've been looking really hard at all of the way**(s)** one can develop web applications using Python. For reference, we are using RHEL 64bit, apache, mod_wsgi.
History:
PHP + MySQL years ago
PHP + Python 2.x + MySQL recently and current
Python + PostgreSQL working on it
We use a great library for communicating betwe... |
Werkzeug in General, and in Python 3.1 | 1,523,934 | 1 | 2 | 2,259 | 1 | python,python-3.x,werkzeug | I haven't used Werkzeug, so I can only answer question 2:
No, Werkzeug does not work on Python 3. In fact, very little works on Python 3 as of today. Porting is not difficult, but you can't port until all your third-party libraries have been ported, so progress is slow.
One big stopper has been setuptools, which is a v... | 0 | 1 | 0 | 0 | 2009-10-06T05:13:00.000 | 3 | 0.066568 | false | 1,523,706 | 0 | 0 | 1 | 3 | I've been looking really hard at all of the way**(s)** one can develop web applications using Python. For reference, we are using RHEL 64bit, apache, mod_wsgi.
History:
PHP + MySQL years ago
PHP + Python 2.x + MySQL recently and current
Python + PostgreSQL working on it
We use a great library for communicating betwe... |
Werkzeug in General, and in Python 3.1 | 1,525,943 | 3 | 2 | 2,259 | 1 | python,python-3.x,werkzeug | mod_wsgi for Python 3.x is also not ready. There is no satisfactory definition of WSGI for Python 3.x yet; the WEB-SIG are still bashing out the issues. mod_wsgi targets a guess at what might be in it, but there are very likely to be changes to both the spec and to standard libraries. Any web application you write toda... | 0 | 1 | 0 | 0 | 2009-10-06T05:13:00.000 | 3 | 0.197375 | false | 1,523,706 | 0 | 0 | 1 | 3 | I've been looking really hard at all of the way**(s)** one can develop web applications using Python. For reference, we are using RHEL 64bit, apache, mod_wsgi.
History:
PHP + MySQL years ago
PHP + Python 2.x + MySQL recently and current
Python + PostgreSQL working on it
We use a great library for communicating betwe... |
Reasons to use distutils when packaging C/Python project | 1,523,993 | 1 | 0 | 284 | 0 | python,c,packaging,distutils | distutils can be used to install end user programs, but it's most useful when using it for Python libraries, as it can create source packages and also install them in the correct place. For that I would say it's more or less required.
But for an end user Python program you can also use make or whatever you like and are... | 0 | 1 | 0 | 1 | 2009-10-06T06:17:00.000 | 2 | 1.2 | true | 1,523,874 | 0 | 0 | 0 | 2 | I have an open source project containing both Python and C code. I'm wondering that is there any use for distutils for me, because I'm planning to do a ubuntu/debian package. The C code is not something that I could or want to use as Python extension. C and Python programs communicate with TCP/IP through localhost.
So ... |
Reasons to use distutils when packaging C/Python project | 1,525,194 | 1 | 0 | 284 | 0 | python,c,packaging,distutils | Because it uses an unified python setup.py install command? distutils, or setuptools? Whatever, just use one of those.
For development, it's also really useful because you don't have to care where to find such and such dependency. As long as it's standard Python/basic system library stuff, setup.py should find it for y... | 0 | 1 | 0 | 1 | 2009-10-06T06:17:00.000 | 2 | 0.099668 | false | 1,523,874 | 0 | 0 | 0 | 2 | I have an open source project containing both Python and C code. I'm wondering that is there any use for distutils for me, because I'm planning to do a ubuntu/debian package. The C code is not something that I could or want to use as Python extension. C and Python programs communicate with TCP/IP through localhost.
So ... |
how to create new file using python | 1,529,596 | 1 | 1 | 1,509 | 0 | python,macos,osx-leopard | It probably failed because /var/log has user set to root and group set to wheel. Try running your python code as root and it will probably work. | 0 | 1 | 0 | 0 | 2009-10-07T05:07:00.000 | 3 | 0.066568 | false | 1,529,584 | 1 | 0 | 0 | 1 | how can i create new file in /var/log directory using python language in OSX leopard? i tried to do it using os.open function but i get "permission denied"
thanks in advance |
Reading HKEY CURRENT USER from the registry in Python, specifying the user | 1,532,868 | 2 | 1 | 8,899 | 0 | python,windows,registry | HKEY_CURRENT_USER maps to a HKEY_USERS\{id} key.
Try finding the id by matching the HKEY_USERS{id}\Volatile Environment\USERNAME key to the username of the user (by enumerating/iterating over the {id}s that are present on the system). When you find the match just use HKEY_USERS{id} as if it was HKEY_CURRENT_USER | 0 | 1 | 0 | 0 | 2009-10-07T15:20:00.000 | 3 | 0.132549 | false | 1,532,306 | 1 | 0 | 0 | 1 | In my application I run subprocesses under several different user accounts. I need to be able to read some of the information written to the registry by these subprocesses. Each one is writing to HKEY_CURRENT_USER, and I know the user account name that they are running under.
In Python, how can I read values from HKEY_... |
Use different Python version with virtualenv | 65,076,532 | 1 | 1,453 | 1,338,259 | 0 | python,virtualenv,virtualenvwrapper | Surprised that no one has mentioned conda so far. I have found this is a lot more straightforward than the other methods mentioned here. Let's say I have python 3.9 and python 2.7 and a project I am working on was python 3.5.4, I could simply create the isolated virtual env for 3.5.4 with the conda command without down... | 0 | 1 | 0 | 0 | 2009-10-07T21:11:00.000 | 36 | 0.005555 | false | 1,534,210 | 1 | 0 | 0 | 6 | I have a Debian system currently running with python 2.5.4. I got virtualenv properly installed, everything is working fine. Is there a possibility that I can use a virtualenv with a different version of Python?
I compiled Python 2.6.2 and would like to use it with some virtualenv. Is it enough to overwrite the binary ... |
Use different Python version with virtualenv | 57,087,622 | 1 | 1,453 | 1,338,259 | 0 | python,virtualenv,virtualenvwrapper | Yes you just need to install the other version of python, and define the location of your other version of python in your command like :
virtualenv /home/payroll/Documents/env -p /usr/bin/python3 | 0 | 1 | 0 | 0 | 2009-10-07T21:11:00.000 | 36 | 0.005555 | false | 1,534,210 | 1 | 0 | 0 | 6 | I have a Debian system currently running with python 2.5.4. I got virtualenv properly installed, everything is working fine. Is there a possibility that I can use a virtualenv with a different version of Python?
I compiled Python 2.6.2 and would like to use it with some virtualenv. Is it enough to overwrite the binary ... |
Use different Python version with virtualenv | 55,512,212 | 2 | 1,453 | 1,338,259 | 0 | python,virtualenv,virtualenvwrapper | This was a bug with virtualenv.
Just upgrading your pip should be the fix.
pip install --upgrade virtualenv | 0 | 1 | 0 | 0 | 2009-10-07T21:11:00.000 | 36 | 0.011111 | false | 1,534,210 | 1 | 0 | 0 | 6 | I have a Debian system currently running with python 2.5.4. I got virtualenv properly installed, everything is working fine. Is there a possibility that I can use a virtualenv with a different version of Python?
I compiled Python 2.6.2 and would like to use it with some virtualenv. Is it enough to overwrite the binary ... |
Use different Python version with virtualenv | 56,665,285 | 1 | 1,453 | 1,338,259 | 0 | python,virtualenv,virtualenvwrapper | It worked for me on windows with python 2 installation :
Step 1: Install python 3 version .
Step 2: create a env folder for
the virtual environment.
Step 3 : c:\Python37\python -m venv
c:\path\to\env.
This is how i created Python 3 virtual environment on my existing python 2 installation. | 0 | 1 | 0 | 0 | 2009-10-07T21:11:00.000 | 36 | 0.005555 | false | 1,534,210 | 1 | 0 | 0 | 6 | I have a Debian system currently running with python 2.5.4. I got virtualenv properly installed, everything is working fine. Is there a possibility that I can use a virtualenv with a different version of Python?
I compiled Python 2.6.2 and would like to use it with some virtualenv. Is it enough to overwrite the binary ... |
Use different Python version with virtualenv | 51,188,487 | 23 | 1,453 | 1,338,259 | 0 | python,virtualenv,virtualenvwrapper | These two commands should work fine.
virtualenv -p python2 myenv (For python2)
virtualenv -p python3 myenv (For python3) | 0 | 1 | 0 | 0 | 2009-10-07T21:11:00.000 | 36 | 1 | false | 1,534,210 | 1 | 0 | 0 | 6 | I have a Debian system currently running with python 2.5.4. I got virtualenv properly installed, everything is working fine. Is there a possibility that I can use a virtualenv with a different version of Python?
I compiled Python 2.6.2 and would like to use it with some virtualenv. Is it enough to overwrite the binary ... |
Use different Python version with virtualenv | 39,574,443 | 8 | 1,453 | 1,338,259 | 0 | python,virtualenv,virtualenvwrapper | Even easier, by using command substitution to find python2 for you:
virtualenv -p $(which python2) <path/to/new/virtualenv/>
Or when using virtualenvwrapper :
mkvirtualenv -p $(which python2) <env_name> | 0 | 1 | 0 | 0 | 2009-10-07T21:11:00.000 | 36 | 1 | false | 1,534,210 | 1 | 0 | 0 | 6 | I have a Debian system currently running with python 2.5.4. I got virtualenv properly installed, everything is working fine. Is there a possibility that I can use a virtualenv with a different version of Python?
I compiled Python 2.6.2 and would like to use it with some virtualenv. Is it enough to overwrite the binary ... |
A .net wrapper for Google App Engine? | 17,356,271 | 0 | 3 | 3,521 | 0 | java,.net,python,web-services,google-app-engine | Python has a .NET alternative called IronPython. But I don't think it will work in GAE as it supports only pure python. I am also facing a similar problem trying to port a source written in C#.net into GAE compatible code. I'm going to work around it by re-inventing the spokes of the wheel (not the wheel itself) by re-... | 0 | 1 | 0 | 0 | 2009-10-09T03:59:00.000 | 3 | 0 | false | 1,541,722 | 0 | 0 | 1 | 1 | Does anyone know of a .net wrapper around either python or java Google App Engine services?
Any help appreciated // :) |
Upgrade Python to 2.6 on Mac | 1,541,785 | 6 | 14 | 13,472 | 0 | python,macos,installation,upgrade | May I suggest you leave the "Default" be, and install Python in /usr/local/bin.
Download python
Unzip it
./configure
make
sudo make install
done.
Since /usr/local/bin comes before /usr/bin in the $PATH, you will invoke 2.6 when you type python, but the OS will remain stable... | 0 | 1 | 0 | 0 | 2009-10-09T04:24:00.000 | 7 | 1 | false | 1,541,776 | 1 | 0 | 0 | 2 | I'd like to upgrade the default python installation (2.5.1) supplied with OS X Leopard to the latest version. Please let me know how I can achieve this.
Thanks |
Upgrade Python to 2.6 on Mac | 1,541,850 | 20 | 14 | 13,472 | 0 | python,macos,installation,upgrade | When an OS is distributed with some specific Python release and uses it for some OS functionality (as is the case with Mac OS X, as well as many Linux distros &c), you should not tamper in any way with the system-supplied Python (as in, "upgrading" it and the like): while Python strives for backwards compatibility with... | 0 | 1 | 0 | 0 | 2009-10-09T04:24:00.000 | 7 | 1 | false | 1,541,776 | 1 | 0 | 0 | 2 | I'd like to upgrade the default python installation (2.5.1) supplied with OS X Leopard to the latest version. Please let me know how I can achieve this.
Thanks |
Traffic shaping under Linux | 1,548,761 | 0 | 5 | 4,040 | 0 | python,linux,ubuntu,trafficshaping | Is there any reason you wish to use python? As mentioned, it will likely only hand-off to already developed tools for this purpose. However, if you look around, you can find things such as Click! modular router, XORP, and others that provide a drop-in for things you want to do - not to mention all the suggestions alrea... | 0 | 1 | 0 | 0 | 2009-10-10T14:24:00.000 | 4 | 0 | false | 1,548,086 | 0 | 0 | 0 | 1 | Where can I learn about controlling/interrogating the network interface under Linux? I'd like to get specific application upload/download speeds, and enforce a speed limit for a specific application.
I'd particularly like information that can help me write a traffic shaping application using Python. |
Recommendations for perl-to-python interoperation? | 1,557,216 | 2 | 1 | 406 | 0 | python,perl | Well, if you really want to write the GUI in another language (which, seriously, is just a bad idea, since it will cost you more than it could ever benefit you), the thing you should do is the following:
Document your Perl app in terms of the services it provides. You should do it with XML Schema Definition - XSD - fo... | 0 | 1 | 0 | 1 | 2009-10-12T20:22:00.000 | 8 | 0.049958 | false | 1,556,668 | 0 | 0 | 0 | 3 | We have a sizable code base in Perl. For the forseeable future, our codebase will remain in Perl. However, we're looking into adding a GUI-based dashboard utility. We are considering writing the dashboard in Python (using tkinter or wx). The problem, however, is that we would like to leverage our existing Perl codebase... |
Recommendations for perl-to-python interoperation? | 1,560,979 | 1 | 1 | 406 | 0 | python,perl | Interesting project: I would opt for loose-coupling and consider an XML-RPC or JSON based approach. | 0 | 1 | 0 | 1 | 2009-10-12T20:22:00.000 | 8 | 0.024995 | false | 1,556,668 | 0 | 0 | 0 | 3 | We have a sizable code base in Perl. For the forseeable future, our codebase will remain in Perl. However, we're looking into adding a GUI-based dashboard utility. We are considering writing the dashboard in Python (using tkinter or wx). The problem, however, is that we would like to leverage our existing Perl codebase... |
Recommendations for perl-to-python interoperation? | 1,557,825 | 7 | 1 | 406 | 0 | python,perl | I hate to be another one in the chorus, but...
Avoid the use of an alternate language
Use Wx so it's native look and feel makes the application look "real" to non-technical audiences.
Download the Padre source code and see how it does Wx Perl code, then steal rampantly from it's best tricks or maybe just gut it and us... | 0 | 1 | 0 | 1 | 2009-10-12T20:22:00.000 | 8 | 1 | false | 1,556,668 | 0 | 0 | 0 | 3 | We have a sizable code base in Perl. For the forseeable future, our codebase will remain in Perl. However, we're looking into adding a GUI-based dashboard utility. We are considering writing the dashboard in Python (using tkinter or wx). The problem, however, is that we would like to leverage our existing Perl codebase... |
Create a user-group in linux using python | 1,571,882 | 1 | 6 | 6,393 | 0 | python,linux,usergroups | There are no library calls for creating a group. This is because there's really no such thing as creating a group. A GID is simply a number assigned to a process or a file. All these numbers exist already - there is nothing you need to do to start using a GID. With the appropriate privileges, you can call chown(2) to s... | 0 | 1 | 0 | 0 | 2009-10-15T05:13:00.000 | 4 | 0.049958 | false | 1,570,401 | 0 | 0 | 0 | 3 | I want to create a user group using python on CentOS system. When I say 'using python' I mean I don't want to do something like os.system and give the unix command to create a new group. I would like to know if there is any python module that deals with this.
Searching on the net did not reveal much about what I want, ... |
Create a user-group in linux using python | 1,570,429 | 5 | 6 | 6,393 | 0 | python,linux,usergroups | I think you should use the commandline programs from your program, a lot of care has gone into making sure that they don't break the groups file if something goes wrong.
However the file format is quite straight forward to write something yourself if you choose to go that way | 0 | 1 | 0 | 0 | 2009-10-15T05:13:00.000 | 4 | 0.244919 | false | 1,570,401 | 0 | 0 | 0 | 3 | I want to create a user group using python on CentOS system. When I say 'using python' I mean I don't want to do something like os.system and give the unix command to create a new group. I would like to know if there is any python module that deals with this.
Searching on the net did not reveal much about what I want, ... |
Create a user-group in linux using python | 1,570,448 | 11 | 6 | 6,393 | 0 | python,linux,usergroups | I don't know of a python module to do it, but the /etc/group and /etc/gshadow format is pretty standard, so if you wanted you could just open the files, parse their current contents and then add the new group if necessary.
Before you go doing this, consider:
What happens if you try to add a group that already exists o... | 0 | 1 | 0 | 0 | 2009-10-15T05:13:00.000 | 4 | 1.2 | true | 1,570,401 | 0 | 0 | 0 | 3 | I want to create a user group using python on CentOS system. When I say 'using python' I mean I don't want to do something like os.system and give the unix command to create a new group. I would like to know if there is any python module that deals with this.
Searching on the net did not reveal much about what I want, ... |
Python - Twisted and Unit Tests | 1,580,776 | 4 | 19 | 5,134 | 0 | python,unit-testing,twisted | As others mentioned, you should be using Trial for unit tests in Twisted.
You also should be unit testing from the bottom up - that's what the "unit" in unit testing implies. Test your data and logic before you test your interface. For a HTTP interface, you should be calling processGET, processPOST, etc with a mock r... | 0 | 1 | 0 | 1 | 2009-10-16T01:03:00.000 | 4 | 0.197375 | false | 1,575,966 | 0 | 0 | 0 | 1 | I'm writing unit tests for a portion of an application that runs as an HTTP server. The approach I have been trying to take is to import the module that contains the HTTP server, start it. Then, the unit tests will use urllib2 to connect, send data, and check the response.
Our HTTP server is using Twisted. One probl... |
What are the use cases for non relational datastores? | 1,588,748 | 2 | 3 | 587 | 1 | python,google-app-engine,couchdb | Consider the situation where you have many entity types but few instances of each entity. In this case you will have many tables each with a few records so a relational approach is not suitable. | 0 | 1 | 0 | 0 | 2009-10-19T13:36:00.000 | 3 | 0.132549 | false | 1,588,708 | 0 | 0 | 1 | 2 | I'm looking at using CouchDB for one project and the GAE app engine datastore in the other. For relational stuff I tend to use postgres, although I much prefer an ORM.
Anyway, what use cases suit non relational datastores best? |
What are the use cases for non relational datastores? | 1,589,186 | 0 | 3 | 587 | 1 | python,google-app-engine,couchdb | In some cases that are simply nice. ZODB is a Python-only object database, that is so well-integrated with Python that you can simply forget that it's there. You don't have to bother about it, most of the time. | 0 | 1 | 0 | 0 | 2009-10-19T13:36:00.000 | 3 | 0 | false | 1,588,708 | 0 | 0 | 1 | 2 | I'm looking at using CouchDB for one project and the GAE app engine datastore in the other. For relational stuff I tend to use postgres, although I much prefer an ORM.
Anyway, what use cases suit non relational datastores best? |
Google App Engine compatibility layer | 4,219,064 | 0 | 6 | 702 | 0 | python,google-app-engine | If you develop with web2py your code will run GAE other architectures wihtout changes using any of the 10 supported relational databases. The compatibility layer covers database api (including blobs and listproperty), email, and fetching). | 0 | 1 | 0 | 0 | 2009-10-19T16:33:00.000 | 5 | 0 | false | 1,589,743 | 0 | 0 | 1 | 1 | I'm planning an application running on Google App Engine. The only worry I would have is portability. Or just the option to have the app run on a local, private cluster.
I expected an option for Google App Engine applications to run on other systems, a compatibility layer, to spring up. I could imagine a GAE compatibl... |
Scheduled tasks in Win32 | 1,591,169 | 1 | 1 | 3,296 | 0 | python,windows-xp,scheduled-tasks | At the risk of not answering your question, can I suggest that if what you have to run is important or even critical then Windows task-Scheduler is not the way to run it.
There are so many awful flows when using the task-scheduler. Lets just start with the obvious ones:
There is no logging. There is no way to investig... | 0 | 1 | 0 | 0 | 2009-10-19T19:03:00.000 | 7 | 0.028564 | false | 1,590,474 | 0 | 0 | 0 | 4 | I have a Scheduled Task on a WinXP SP2 machine that is set up to run a python script:
Daily
Start time: 12:03 AM
Schedule task daily: every 1 day
Start date: some time in the past
Repeat task: every 5 minutes
Until: Duration 24 hours
Basically, i want the script to run every five minutes, for ever.
My problem is the ta... |
Scheduled tasks in Win32 | 1,590,518 | 1 | 1 | 3,296 | 0 | python,windows-xp,scheduled-tasks | On the first pane (labeled "Task") do you have "Run only if logged on" unchecked and "Enabled (scheduled task runs at specified time" checked?
I've run python jobs via Windows scheduled task with settings very similar to what you show. | 0 | 1 | 0 | 0 | 2009-10-19T19:03:00.000 | 7 | 0.028564 | false | 1,590,474 | 0 | 0 | 0 | 4 | I have a Scheduled Task on a WinXP SP2 machine that is set up to run a python script:
Daily
Start time: 12:03 AM
Schedule task daily: every 1 day
Start date: some time in the past
Repeat task: every 5 minutes
Until: Duration 24 hours
Basically, i want the script to run every five minutes, for ever.
My problem is the ta... |
Scheduled tasks in Win32 | 1,590,558 | 1 | 1 | 3,296 | 0 | python,windows-xp,scheduled-tasks | Also, for the past year or so I've seen a common bug where Scheduled Tasks on Server 2003 or XP do not run if either of the following checkboxes are on:
"Don't start the task if the computer is running on batteries"
"Stop the task if battery mode begins"
It seems that Windows gets a little confused if you have a batt... | 0 | 1 | 0 | 0 | 2009-10-19T19:03:00.000 | 7 | 0.028564 | false | 1,590,474 | 0 | 0 | 0 | 4 | I have a Scheduled Task on a WinXP SP2 machine that is set up to run a python script:
Daily
Start time: 12:03 AM
Schedule task daily: every 1 day
Start date: some time in the past
Repeat task: every 5 minutes
Until: Duration 24 hours
Basically, i want the script to run every five minutes, for ever.
My problem is the ta... |
Scheduled tasks in Win32 | 1,590,873 | 1 | 1 | 3,296 | 0 | python,windows-xp,scheduled-tasks | Until: Duration 24 hours
That shuts it off at the end of the first day.
Remove that, see if it keeps going. It should, and you shouldn't need to install Python in the process. :) | 0 | 1 | 0 | 0 | 2009-10-19T19:03:00.000 | 7 | 0.028564 | false | 1,590,474 | 0 | 0 | 0 | 4 | I have a Scheduled Task on a WinXP SP2 machine that is set up to run a python script:
Daily
Start time: 12:03 AM
Schedule task daily: every 1 day
Start date: some time in the past
Repeat task: every 5 minutes
Until: Duration 24 hours
Basically, i want the script to run every five minutes, for ever.
My problem is the ta... |
Is there any simple way to benchmark Python script? | 5,544,739 | 12 | 105 | 101,454 | 0 | python,unix,shell,benchmarking | I usually do a quick time ./script.py to see how long it takes. That does not show you the memory though, at least not as a default. You can use /usr/bin/time -v ./script.py to get a lot of information, including memory usage. | 0 | 1 | 0 | 1 | 2009-10-20T07:40:00.000 | 12 | 1 | false | 1,593,019 | 1 | 0 | 0 | 1 | Usually I use shell command time. My purpose is to test if data is small, medium, large or very large set, how much time and memory usage will be.
Any tools for Linux or just Python to do this? |
Get the request uri outside of a RequestHandler in Google App Engine (Python) | 1,593,985 | 2 | 1 | 786 | 0 | python,google-app-engine | You should generally be doing everything within some sort of RequestHandler or the equivalent in your non-WebApp framework. However, if you really insist on being stuck in the early 1990s and writing plain CGI scripts, the environment variables SERVER_NAME and PATH_INFO may be what you want; see a CGI reference for mo... | 0 | 1 | 1 | 0 | 2009-10-20T09:33:00.000 | 2 | 1.2 | true | 1,593,483 | 0 | 0 | 1 | 1 | So, within a webapp.RequestHandler subclass I would use self.request.uri to get the request URI. But, I can't access this outside of a RequestHandler and so no go. Any ideas?
I'm running Python and I'm new at it as well as GAE. |
How to make a Python script run like a service or daemon in Linux | 8,956,634 | 11 | 213 | 365,270 | 0 | python,linux,scripting,daemons | how about using $nohup command on linux?
I use it for running my commands on my Bluehost server.
Please advice if I am wrong. | 0 | 1 | 0 | 1 | 2009-10-21T19:36:00.000 | 16 | 1 | false | 1,603,109 | 0 | 0 | 0 | 4 | I have written a Python script that checks a certain e-mail address and passes new e-mails to an external program. How can I get this script to execute 24/7, such as turning it into daemon or service in Linux. Would I also need a loop that never ends in the program, or can it be done by just having the code re execut... |
How to make a Python script run like a service or daemon in Linux | 35,008,431 | 7 | 213 | 365,270 | 0 | python,linux,scripting,daemons | If you are using terminal(ssh or something) and you want to keep a long-time script working after you log out from the terminal, you can try this:
screen
apt-get install screen
create a virtual terminal inside( namely abc): screen -dmS abc
now we connect to abc: screen -r abc
So, now we can run python script: python ke... | 0 | 1 | 0 | 1 | 2009-10-21T19:36:00.000 | 16 | 1 | false | 1,603,109 | 0 | 0 | 0 | 4 | I have written a Python script that checks a certain e-mail address and passes new e-mails to an external program. How can I get this script to execute 24/7, such as turning it into daemon or service in Linux. Would I also need a loop that never ends in the program, or can it be done by just having the code re execut... |
How to make a Python script run like a service or daemon in Linux | 20,908,406 | 1 | 213 | 365,270 | 0 | python,linux,scripting,daemons | Use whatever service manager your system offers - for example under Ubuntu use upstart. This will handle all the details for you such as start on boot, restart on crash, etc. | 0 | 1 | 0 | 1 | 2009-10-21T19:36:00.000 | 16 | 0.012499 | false | 1,603,109 | 0 | 0 | 0 | 4 | I have written a Python script that checks a certain e-mail address and passes new e-mails to an external program. How can I get this script to execute 24/7, such as turning it into daemon or service in Linux. Would I also need a loop that never ends in the program, or can it be done by just having the code re execut... |
How to make a Python script run like a service or daemon in Linux | 19,515,492 | 12 | 213 | 365,270 | 0 | python,linux,scripting,daemons | cron is clearly a great choice for many purposes. However it doesn't create a service or daemon as you requested in the OP. cron just runs jobs periodically (meaning the job starts and stops), and no more often than once / minute. There are issues with cron -- for example, if a prior instance of your script is still... | 0 | 1 | 0 | 1 | 2009-10-21T19:36:00.000 | 16 | 1 | false | 1,603,109 | 0 | 0 | 0 | 4 | I have written a Python script that checks a certain e-mail address and passes new e-mails to an external program. How can I get this script to execute 24/7, such as turning it into daemon or service in Linux. Would I also need a loop that never ends in the program, or can it be done by just having the code re execut... |
kill subprocess when python process is killed? | 1,603,828 | 0 | 6 | 3,964 | 0 | python,windows,process | subprocess.Popen objects come with a kill and a terminate method (differs in which signal you send to the process).
signal.signal allows you install signal handlers, in which you can call the child's kill method. | 0 | 1 | 0 | 0 | 2009-10-21T21:08:00.000 | 3 | 0 | false | 1,603,658 | 0 | 0 | 0 | 1 | I am writing a python program that lauches a subprocess (using Popen).
I am reading stdout of the subprocess, doing some filtering, and writing to
stdout of main process.
When I kill the main process (cntl-C) the subprocess keeps running.
How do I kill the subprocess too? The subprocess is likey to run a long time.
Con... |
Python debugging in Netbeans | 1,606,803 | 1 | 4 | 2,156 | 0 | python,netbeans | I just installed Python for NetBeans yesterday and hadn't tried the debugger, so just tried it, and I got the same error. So I thought maybe it's a Firewall issue, disabled my Firewall and retried it, and then it worked.
However I restarted the Firewall and now it's still working, so I don't know. I saw the Netbeans op... | 0 | 1 | 0 | 0 | 2009-10-22T12:02:00.000 | 2 | 0.099668 | false | 1,606,746 | 0 | 0 | 1 | 2 | I have a problem with debugging Python programs under the Netbeans IDE. When I start debugging, the debugger writes the following log and error. Thank you for help.
[LOG]PythonDebugger : overall Starting
>>>[LOG]PythonDebugger.taskStarted : I am Starting a new Debugging Session ...
[LOG]This window is an interactive d... |
Python debugging in Netbeans | 1,636,617 | 1 | 4 | 2,156 | 0 | python,netbeans | For Python I like WingIDE from Wingware. | 0 | 1 | 0 | 0 | 2009-10-22T12:02:00.000 | 2 | 0.099668 | false | 1,606,746 | 0 | 0 | 1 | 2 | I have a problem with debugging Python programs under the Netbeans IDE. When I start debugging, the debugger writes the following log and error. Thank you for help.
[LOG]PythonDebugger : overall Starting
>>>[LOG]PythonDebugger.taskStarted : I am Starting a new Debugging Session ...
[LOG]This window is an interactive d... |
What profiling tools exist for Python on Linux beyond the ones included in the standard library? | 1,608,157 | 2 | 1 | 1,160 | 0 | python,linux,profiling | I'm not sure if python will provide the low level information you are looking for. You might want to look at oprofile and latencytop though. | 0 | 1 | 0 | 1 | 2009-10-22T14:29:00.000 | 2 | 0.197375 | false | 1,607,641 | 0 | 0 | 0 | 1 | I've been using Python's built-in cProfile tool with some pretty good success. But I'd like to be able to access more information such as how long I'm waiting for I/O (and what kind of I/O I'm waiting on) or how many cache misses I have. Are there any Linux tools to help with this beyond your basic time command? |
Run time of a subprocess.Popen instance | 1,608,884 | 1 | 1 | 1,488 | 0 | python,subprocess | No, but you can simply subclass and extend the Popen class to store the time it was created. | 0 | 1 | 0 | 0 | 2009-10-22T17:26:00.000 | 3 | 1.2 | true | 1,608,724 | 0 | 0 | 0 | 1 | Is there an easy way to find out the current (real or cpu) run time of a subprocess.Popen instance? |
Determine if a script is running in pythonw? | 1,611,558 | 5 | 2 | 1,325 | 0 | python,pythonw | sys.executable -- "A string giving the name of the executable binary for the Python interpreter, on systems where this makes sense." | 0 | 1 | 0 | 1 | 2009-10-23T05:31:00.000 | 1 | 1.2 | true | 1,611,543 | 0 | 0 | 0 | 1 | I would like to redirect stderr and stdout to files when run inside of pythonw. How can I determine whether a script is running in pythonw or in python? |
Running Python from the Windows Command Line | 1,615,021 | 5 | 1 | 15,004 | 0 | python,windows | If you don't want to install an IDE, you can also use IDLE which includes a Python editor and a console to test things out, this is part of the standard installation.
If you installed the python.org version, you will see an IDLE (Python GUI) in your start menu. I would recommend adding it to your Quick Launch or your d... | 0 | 1 | 0 | 0 | 2009-10-23T17:33:00.000 | 7 | 0.141893 | false | 1,614,898 | 1 | 0 | 0 | 4 | How do I run a Python file from the Windows Command Line (cmd.exe) so that I won't have to re-enter the code each time? |
Running Python from the Windows Command Line | 1,614,915 | 0 | 1 | 15,004 | 0 | python,windows | In DOS you can use edit to create/modify text files, then execute them by typing python [yourfile] | 0 | 1 | 0 | 0 | 2009-10-23T17:33:00.000 | 7 | 0 | false | 1,614,898 | 1 | 0 | 0 | 4 | How do I run a Python file from the Windows Command Line (cmd.exe) so that I won't have to re-enter the code each time? |
Running Python from the Windows Command Line | 1,614,908 | 2 | 1 | 15,004 | 0 | python,windows | If you put the Python executable (python.exe) on your path, you can invoke your script using python script.py where script.py is the Python file that you want to execute. | 0 | 1 | 0 | 0 | 2009-10-23T17:33:00.000 | 7 | 0.057081 | false | 1,614,898 | 1 | 0 | 0 | 4 | How do I run a Python file from the Windows Command Line (cmd.exe) so that I won't have to re-enter the code each time? |
Running Python from the Windows Command Line | 1,614,906 | 0 | 1 | 15,004 | 0 | python,windows | Open a command prompt, by pressing Win+R and writing cmd in that , navigate to the script directory , and write : python script.py | 0 | 1 | 0 | 0 | 2009-10-23T17:33:00.000 | 7 | 0 | false | 1,614,898 | 1 | 0 | 0 | 4 | How do I run a Python file from the Windows Command Line (cmd.exe) so that I won't have to re-enter the code each time? |
How to get duration of video flash file? | 1,617,438 | 3 | 2 | 1,706 | 0 | python,flash | One way it can be done using ffmpeg. ffmpeg needs to be installed with h.264 and h.263 codec support. Then following is the command to retrieve the video duration, which can be called via python system(command).
ffmpeg -i flv_file 2>&1 | grep "Duration" | cut -d ' ' -f 4 | sed s/,// | 0 | 1 | 0 | 0 | 2009-10-23T20:21:00.000 | 2 | 1.2 | true | 1,615,690 | 0 | 0 | 0 | 1 | On Linux, YouTube places temporary flash files in /tmp. Nautilus can display the duration (Minutes:Seconds) of them, but I haven't found a way to extract the duration using python.'
The fewer dependencies your method requires the better.
Thanks in advance. |
Generating Separate Output files in Hadoop Streaming | 1,664,639 | 1 | 9 | 4,270 | 0 | python,streaming,hadoop,mapreduce | Is it possible to replace the outputFormatClass, when using streaming?
In a native Java implementation you would extend the MultipleTextOutputFormat class and modify the method that names the output file. Then define your implementation as new outputformat with JobConf's setOutputFormat method
you should verify, if thi... | 0 | 1 | 0 | 0 | 2009-10-26T19:17:00.000 | 3 | 0.066568 | false | 1,626,786 | 0 | 0 | 0 | 1 | Using only a mapper (a Python script) and no reducer, how can I output a separate file with the key as the filename, for each line of output, rather than having long files of output? |
No IDLE for Python 3? | 19,543,322 | 3 | 6 | 12,340 | 0 | python,python-3.x,python-idle | Type 'idle3' in the terminal window. That should launch your copy of idle 3.1 | 0 | 1 | 0 | 0 | 2009-10-27T13:15:00.000 | 2 | 0.291313 | false | 1,630,728 | 1 | 0 | 0 | 1 | I installed Python 3.1 yesterday on my Windows Vista PC, and was surprised to find that the version of IDLE is 2.6.4, for "Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on win32"
I was hoping to use IDLE to investigate some of the new features of Python 3...
I guess I'm stuck with the com... |
How to permanently append a path to Python for Linux? | 1,641,426 | 11 | 4 | 1,063 | 0 | python | Find your site-packages directory and create a new file called myproj.pth
Inside that file, put each directory you want to add, one per line like so:
/home/myuser/svn-repos/myproject
/home/myuser/svn-repos/SomeOtherProject
Python loads *.pth every time it runs, and imports all paths in each of those files.
In Ubuntu... | 0 | 1 | 0 | 0 | 2009-10-29T03:11:00.000 | 2 | 1.2 | true | 1,641,418 | 1 | 0 | 0 | 2 | I know there are multiple solutions online, but some are for windows, some are environmental variable, etc..
What is the best way? |
How to permanently append a path to Python for Linux? | 1,641,468 | 1 | 4 | 1,063 | 0 | python | I personally just define PYTHONPATH in ~/.bashrc, as for what's the "best" approach? I think that's hard to answer (or rather, there's no correct answer). It depends. | 0 | 1 | 0 | 0 | 2009-10-29T03:11:00.000 | 2 | 0.099668 | false | 1,641,418 | 1 | 0 | 0 | 2 | I know there are multiple solutions online, but some are for windows, some are environmental variable, etc..
What is the best way? |
Killing Python webservers | 1,643,387 | 1 | 1 | 410 | 0 | python | Raise exeption and handle it in main or use sys.exit | 0 | 1 | 0 | 1 | 2009-10-29T12:26:00.000 | 4 | 0.049958 | false | 1,643,362 | 0 | 0 | 0 | 1 | I am looking for a simple Python webserver that is easy to kill from within code. Right now, I'm playing with Bottle, but I can't find any way at all to kill it in code. If you know how to kill Bottle (in code, no Ctrl+C) that would be super, but I'll take anything that's Python, simple, and killable. |
Python on AIX: What are my options? | 1,646,337 | 4 | 6 | 13,755 | 0 | python,aix,ncurses,curses | I'd compile it from source myself and tell them where to download it from in the instructions | 0 | 1 | 0 | 0 | 2009-10-29T20:21:00.000 | 3 | 1.2 | true | 1,646,293 | 1 | 0 | 0 | 1 | I need to make some Python applications for a work project. The target platform is AIX 5.3.
My question is: What version of Python should I be using?
My requirements are:
The Python version must be easy to install on the target machines. Others will do that according to instructions that I write, so no compiling from ... |
mod_python django logging problem | 1,648,183 | 2 | 1 | 556 | 0 | python,django,logging | RotatingFileHandler is not designed to work in multiprocess system. Each process you have notice that file is too large and starts new log, so you get up to 5 new logs. It's not as easy to implement it properly: you have to obtain interprocess lock before creating new file and inform each process to reopen it. You'd be... | 0 | 1 | 0 | 0 | 2009-10-30T04:10:00.000 | 1 | 1.2 | true | 1,647,974 | 0 | 0 | 1 | 1 | I use logging settings as below in the settings.py file:
logging.basicConfig(level=LOG_LEVEL, format=LOG_FORMAT);
handler = logging.handlers.RotatingFileHandler( LOG_FILE_PATH, 'a', LOG_FILE_SIZE,LOG_FILE_NUM );
formatter = logging.Formatter ( LOG_FORMAT );
handler.setFormatter(formatter);
logging.getLogger().addHandl... |
Problem compiling Python 2.6.4 on AIX 5.3 | 9,372,135 | 1 | 0 | 2,579 | 0 | python,compilation,aix,ncurses | This is so old problem(2009 ??)..but I meet the same problem today!!
For other AIX users like me...I will leave my case
OK..first, Check your environmental variable OBJECT_MODE.
In my case, OBJECT_MODE was 64, but the archive file libcurses.a contains
only 32bit object files!!
After changing the environmental variable... | 0 | 1 | 0 | 0 | 2009-10-30T12:04:00.000 | 3 | 0.066568 | false | 1,649,412 | 0 | 0 | 0 | 2 | I'm trying to build Python 2.6.4 on AIX 5.3. I'm running configure like this:
./configure --prefix=/home/chenf/python --disable-ipv6 --disable-shared --with-libs='/usr/lib/libncurses.a' --without-threads --disable-threads --with-ncurses=/utv/sad/ncurses/lib/libncurses.a
I seem to be having linking problems with ncurs... |
Problem compiling Python 2.6.4 on AIX 5.3 | 1,661,609 | 0 | 0 | 2,579 | 0 | python,compilation,aix,ncurses | Thanks to Jed Smith's suggestions, I've managed to get this to work. This is what I did accomplish this:
Step one: First, I edited "Makefile.pre.in". I replaced the line "CC= @CC@" with "CC= gcc". As far as I can tell, this forced the compilation to use gcc instead of whatever other unnamable hideousness AIX tried... | 0 | 1 | 0 | 0 | 2009-10-30T12:04:00.000 | 3 | 0 | false | 1,649,412 | 0 | 0 | 0 | 2 | I'm trying to build Python 2.6.4 on AIX 5.3. I'm running configure like this:
./configure --prefix=/home/chenf/python --disable-ipv6 --disable-shared --with-libs='/usr/lib/libncurses.a' --without-threads --disable-threads --with-ncurses=/utv/sad/ncurses/lib/libncurses.a
I seem to be having linking problems with ncurs... |
getting previously typed commands in python | 1,654,569 | 0 | 0 | 794 | 0 | shell,command,python-idle,python-2.5 | check if there is ipython available on windows .. that offers line history, tab completion and many other nice features | 0 | 1 | 0 | 0 | 2009-10-31T14:23:00.000 | 2 | 0 | false | 1,654,520 | 1 | 0 | 0 | 2 | I'm using python 2.5 in windows on a macbook pro with IDLE. How do I get previously typed commands in the python shell? In other operating systems I've managed to do this using 'ctrl' + 'up arrow' or a similar combination. I've tried all likely combinations without success.
Thanks. |
getting previously typed commands in python | 1,654,586 | 0 | 0 | 794 | 0 | shell,command,python-idle,python-2.5 | I just realized that I can find this out in 'Options -> Configure IDLE -> Keys'
It's 'alt + p' for IDLE. Thanks for the suggestion pfote - I will take a look. | 0 | 1 | 0 | 0 | 2009-10-31T14:23:00.000 | 2 | 1.2 | true | 1,654,520 | 1 | 0 | 0 | 2 | I'm using python 2.5 in windows on a macbook pro with IDLE. How do I get previously typed commands in the python shell? In other operating systems I've managed to do this using 'ctrl' + 'up arrow' or a similar combination. I've tried all likely combinations without success.
Thanks. |
erlang on google app engine? | 1,654,786 | 11 | 2 | 1,713 | 0 | python,google-app-engine,erlang | Erlang and Python are programming languages, and each language has one or more "runtimes" that allow you to run programs written in those languages. GAE supplies a Python runtime.
GAE has no support for Erlang programs. | 0 | 1 | 0 | 0 | 2009-10-31T15:48:00.000 | 1 | 1.2 | true | 1,654,759 | 0 | 0 | 1 | 1 | I know python can be run on GAE
what is different erlang and python in lay man term?
can erlang run on google app engine ? |
Python: Monitoring and killing/throttling spawned processes based on load, time, etc | 2,246,627 | 1 | 4 | 2,059 | 0 | python | Monitor the overall server load (say, load average or equivalent of vmstat) in python?
>>> import psutil, subprocess
>>> subp = subprocess.Popen('python', stdout=subprocess.PIPE, stderr=subprocess.PIPE)
>>> proc = psutil.Process(subp.pid)
>>> rss, vms = proc.get_memory_info()
>>> print "Resident memory: %s KB" %(rss ... | 0 | 1 | 0 | 0 | 2009-10-31T16:53:00.000 | 3 | 0.066568 | false | 1,654,922 | 0 | 0 | 0 | 1 | I have a queue of workers that spawn external third party apps using subprocess. I'd like to control how much of the overall resources of my server these process consume. Some of these external apps also tend to hang for unknown reasons, fixed with a restart.
What's a good way to:
Monitor the overall server load (say,... |
Querying the connecting device for usb devices in OS X | 1,655,945 | 0 | 1 | 477 | 0 | python,macos,usb | You're confusing the term device with the term volume--in this example (and in most real world situations) there would only be one device involved.
The state of most hardware falls under the purview of IOKit, and the only way you can possibly get to this information from Python is through careful parsing of the ioreg ... | 0 | 1 | 0 | 0 | 2009-10-31T23:34:00.000 | 1 | 0 | false | 1,655,927 | 0 | 0 | 0 | 1 | Ok, so here's the setup. In OS X (>= 10.5), is it possible, given a mounted usb device with a known location, say /Volumes/FLASHDRIVE, to find out whether this device is connecting through another usb device (a card reader for example) and if so, which one.
Ideally, this could all be done in python, but if not that's ... |
module to abstract limitations of GQL | 1,660,404 | 1 | 0 | 78 | 1 | python,google-app-engine,gql | I'm not aware of any libraries that do that. You may want to reconsider what you're doing, at least in terms of retrieving more than 1000 results - those operations are not available because they're expensive, and needing to evade them is usually (though not always) a sign that you need to rearchitect your app to do le... | 0 | 1 | 0 | 0 | 2009-11-01T23:54:00.000 | 1 | 1.2 | true | 1,658,829 | 0 | 0 | 0 | 1 | I am after a Python module for Google App Engine that abstracts away limitations of the GQL.
Specifically I want to store big files (> 1MB) and retrieve all records for a model (> 1000). I have my own code that handles this at present but would prefer to build on existing work, if available.
Thanks |
MacPython: programmatically finding all serial ports | 1,659,294 | 1 | 3 | 2,216 | 0 | python,macos,serial-port | What about just doing the os.listdir / glob equivalent of ls to perform the equivalent of that ls? Of course it's not going to be the case that some usable device is connected to each such special file (but, that holds for ls as well;-), but for "finding all serial ports", as you ask in your Q's title, I'm not sure ho... | 0 | 1 | 0 | 1 | 2009-11-02T03:16:00.000 | 2 | 0.099668 | false | 1,659,283 | 0 | 0 | 0 | 1 | I am looking for a solution to programmatically return all available serial ports with python.
At the moment I am entering ls /dev/tty.* or ls /dev/cu.* into the terminal to list ports and hardcoding them into the pyserial class. |
Running Python's IDLE in windows | 1,662,586 | 15 | 8 | 31,240 | 0 | python,windows,python-idle | On my system, running C:\Python26\lib\idlelib\idle.py launches idle from the command prompt. Obviously you will need to adjust your path if your main Python directory isn't C:\Python26\.
It looks like you could also launch it via idle.pyw or idle.bat in that same directory. | 0 | 1 | 0 | 0 | 2009-11-02T17:22:00.000 | 2 | 1.2 | true | 1,662,576 | 1 | 0 | 0 | 2 | I messed up my IDLE shortcut. What is the way to start IDLE from the cmd.exe shell in Windows? |
Running Python's IDLE in windows | 12,381,743 | 2 | 8 | 31,240 | 0 | python,windows,python-idle | You can just add a path in your Environment variables tab in My Computer Properties --> Advanced as c:\Python27\Lib\idlelib. After adding this path just write idle.pyw in cmd whenever you want to run IDLE.
Just make sure you replace the folder name with whatever directory name you have. | 0 | 1 | 0 | 0 | 2009-11-02T17:22:00.000 | 2 | 0.197375 | false | 1,662,576 | 1 | 0 | 0 | 2 | I messed up my IDLE shortcut. What is the way to start IDLE from the cmd.exe shell in Windows? |
How do I mount a filesystem using Python? | 1,667,268 | -15 | 44 | 62,081 | 0 | python,unix | surely this is a nice tidy, python interface to the mount system call.
I can't find it (I thought it would just be a nice, easy os.mount()).
Surely, there is none. What would this function do on Windows?
Use the shell command instead. | 0 | 1 | 0 | 0 | 2009-11-03T13:10:00.000 | 10 | 1.2 | true | 1,667,257 | 0 | 0 | 0 | 4 | I'm sure this is a easy question, my Google-fu is obviously failing me.
How do I mount a filesystem using Python, the equivalent of running the shell command mount ...?
Obviously I can use os.system to run the shell command, but surely there is a nice tidy, Python interface to the mount system call.
I can't find it. I ... |
How do I mount a filesystem using Python? | 1,667,358 | 11 | 44 | 62,081 | 0 | python,unix | Import cdll from ctypes. Then load your os libc, then use libc.mount()
Read libc's docs for mount parameters | 0 | 1 | 0 | 0 | 2009-11-03T13:10:00.000 | 10 | 1 | false | 1,667,257 | 0 | 0 | 0 | 4 | I'm sure this is a easy question, my Google-fu is obviously failing me.
How do I mount a filesystem using Python, the equivalent of running the shell command mount ...?
Obviously I can use os.system to run the shell command, but surely there is a nice tidy, Python interface to the mount system call.
I can't find it. I ... |
How do I mount a filesystem using Python? | 1,667,328 | 0 | 44 | 62,081 | 0 | python,unix | Badly, mounting and unmounting belongs to the things that are highly system dependent and since they are
rarely used and
can affect system stability
There is no solution that is portable available. Since that, I agree with Ferdinand Beyer, that it is unlikely, a general Python solution is existing. | 0 | 1 | 0 | 0 | 2009-11-03T13:10:00.000 | 10 | 0 | false | 1,667,257 | 0 | 0 | 0 | 4 | I'm sure this is a easy question, my Google-fu is obviously failing me.
How do I mount a filesystem using Python, the equivalent of running the shell command mount ...?
Obviously I can use os.system to run the shell command, but surely there is a nice tidy, Python interface to the mount system call.
I can't find it. I ... |
How do I mount a filesystem using Python? | 6,963,468 | 3 | 44 | 62,081 | 0 | python,unix | Note that calling your libc mount function will require root privileges; Popen(['mount'...) only will if the particular mounting isn't blessed in fstab (it is the mount executable, setuid root, that performs these checks). | 0 | 1 | 0 | 0 | 2009-11-03T13:10:00.000 | 10 | 0.059928 | false | 1,667,257 | 0 | 0 | 0 | 4 | I'm sure this is a easy question, my Google-fu is obviously failing me.
How do I mount a filesystem using Python, the equivalent of running the shell command mount ...?
Obviously I can use os.system to run the shell command, but surely there is a nice tidy, Python interface to the mount system call.
I can't find it. I ... |
how to process long-running requests in python workers? | 1,718,183 | 0 | 4 | 2,509 | 0 | python,nginx,load-balancing,wsgi,reverse-proxy | Another option is a queue table in the database.
The worker processes run in a loop or off cron and poll the queue table for new jobs. | 0 | 1 | 1 | 1 | 2009-11-04T15:51:00.000 | 7 | 0 | false | 1,674,696 | 0 | 0 | 0 | 4 | I have a python (well, it's php now but we're rewriting) function that takes some parameters (A and B) and compute some results (finds best path from A to B in a graph, graph is read-only), in typical scenario one call takes 0.1s to 0.9s to complete. This function is accessed by users as a simple REST web-service (GET ... |
how to process long-running requests in python workers? | 1,675,726 | 0 | 4 | 2,509 | 0 | python,nginx,load-balancing,wsgi,reverse-proxy | I think you can configure modwsgi/Apache so it will have several "hot" Python interpreters
in separate processes ready to go at all times and also reuse them for new accesses
(and spawn a new one if they are all busy).
In this case you could load all the preprocessed data as module globals and they would
only get loade... | 0 | 1 | 1 | 1 | 2009-11-04T15:51:00.000 | 7 | 0 | false | 1,674,696 | 0 | 0 | 0 | 4 | I have a python (well, it's php now but we're rewriting) function that takes some parameters (A and B) and compute some results (finds best path from A to B in a graph, graph is read-only), in typical scenario one call takes 0.1s to 0.9s to complete. This function is accessed by users as a simple REST web-service (GET ... |
how to process long-running requests in python workers? | 1,682,864 | 1 | 4 | 2,509 | 0 | python,nginx,load-balancing,wsgi,reverse-proxy | The most simple solution in this case is to use the webserver to do all the heavy lifting. Why should you handle threads and/or processes when the webserver will do all that for you?
The standard arrangement in deployments of Python is:
The webserver start a number of processes each running a complete python interpret... | 0 | 1 | 1 | 1 | 2009-11-04T15:51:00.000 | 7 | 0.028564 | false | 1,674,696 | 0 | 0 | 0 | 4 | I have a python (well, it's php now but we're rewriting) function that takes some parameters (A and B) and compute some results (finds best path from A to B in a graph, graph is read-only), in typical scenario one call takes 0.1s to 0.9s to complete. This function is accessed by users as a simple REST web-service (GET ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.