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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Recover process with subprocess.Popen? | 2,056,808 | 1 | 2 | 1,293 | 0 | python,popen | If a process dies, all its open file handles are closed. This includes any unnamed pipes created by popen(). So, no, there's no way to recover a Popen object from just a PID. The OS won't even consider your new process the parent, so you won't even get SIGCHLD signals (though waitpid() might still work).
I'm not sur... | 0 | 1 | 0 | 0 | 2010-01-13T12:33:00.000 | 3 | 0.066568 | false | 2,056,594 | 0 | 0 | 0 | 2 | I have a python program that uses subprocess.Popen to launch another process (python process or whatever), and after launching it I save the child's PID to a file. Let's suppose that suddenly the parent process dies (because of an exception or whatever). Is there any way to access again to the object returned by Popen?... |
Practices while releasing the python/ruby/script based web applications on production | 2,059,364 | 3 | 1 | 242 | 0 | python,ruby,linux,scripting,release | I would create a branch in SVN for every release of web application and when the release is ready there, I would check it out on the server and set to be run or move it into the place of the old version. | 0 | 1 | 0 | 1 | 2010-01-13T18:52:00.000 | 4 | 1.2 | true | 2,059,337 | 0 | 0 | 1 | 3 | I am purely a windows programmer and spend all my time hacking VC++.
Recently I have been heading several web based applications and myself built applications with python (/pylons framework) and doing projects on rails. All the web projects are hosted on ubuntu linux.
The RELEASE procedures and check list we followed... |
Practices while releasing the python/ruby/script based web applications on production | 4,454,448 | 0 | 1 | 242 | 0 | python,ruby,linux,scripting,release | One downside of doing an svn update: though you can go back in time, to what revision do you go back to? You have to look it up. svn update pseudo-deployments work much cleaner if you use tags - in that case you'd be doing an svn switch to a different tag, not an svn update on the same branch or the trunk.
You want ... | 0 | 1 | 0 | 1 | 2010-01-13T18:52:00.000 | 4 | 0 | false | 2,059,337 | 0 | 0 | 1 | 3 | I am purely a windows programmer and spend all my time hacking VC++.
Recently I have been heading several web based applications and myself built applications with python (/pylons framework) and doing projects on rails. All the web projects are hosted on ubuntu linux.
The RELEASE procedures and check list we followed... |
Practices while releasing the python/ruby/script based web applications on production | 2,059,406 | 2 | 1 | 242 | 0 | python,ruby,linux,scripting,release | Is SVN checkout and svn update are the right methods to update the latest build files into the server?
Very, very good methods. You know what you got. You can go backwards at any time.
Are there any downside in using svn update? None.
Any better method to release the script/web based scripts into the production ser... | 0 | 1 | 0 | 1 | 2010-01-13T18:52:00.000 | 4 | 0.099668 | false | 2,059,337 | 0 | 0 | 1 | 3 | I am purely a windows programmer and spend all my time hacking VC++.
Recently I have been heading several web based applications and myself built applications with python (/pylons framework) and doing projects on rails. All the web projects are hosted on ubuntu linux.
The RELEASE procedures and check list we followed... |
"Real" and non-embedded use of Ruby, Python and their friends | 2,067,929 | 3 | 3 | 464 | 0 | python,ruby,perl,scripting | Python (combined with PyQt) is a very solid combination for GUI desktop applications (note that while QT is LGPL, PyQt (the Python bindings) is dual licensed: GPL or commercial).
It offers the same (GUI library-wise) as Qt on C++ but with Python's specific strenghts. I'll list some of the more obvious ones:
rapid prot... | 0 | 1 | 0 | 1 | 2010-01-14T22:03:00.000 | 7 | 1.2 | true | 2,067,907 | 0 | 0 | 0 | 4 | So I'm aware of the big ammount of general-purpose scripting languages like Ruby, Python, Perl, maybe even PHP, etc. that actually claim being usable for creating desktop applications too.
I think my question can be answered clearly
Are there actually companies using a special scripting language only to create their a... |
"Real" and non-embedded use of Ruby, Python and their friends | 2,068,161 | 6 | 3 | 464 | 0 | python,ruby,perl,scripting | The company I work for uses Perl and Tk with PerlApp to build executable packages to produce or major software application.
Perl beats C and C++ for simplicity of code. You can do things in one line of Perl that take 20 lines of C.
We've used WxPerl for a few smaller projects. We'd like to move fully to WxPerl, but e... | 0 | 1 | 0 | 1 | 2010-01-14T22:03:00.000 | 7 | 1 | false | 2,067,907 | 0 | 0 | 0 | 4 | So I'm aware of the big ammount of general-purpose scripting languages like Ruby, Python, Perl, maybe even PHP, etc. that actually claim being usable for creating desktop applications too.
I think my question can be answered clearly
Are there actually companies using a special scripting language only to create their a... |
"Real" and non-embedded use of Ruby, Python and their friends | 2,072,473 | 2 | 3 | 464 | 0 | python,ruby,perl,scripting | I would recommend you not try to look for a language that is best for GUI apps but instead look for the language that you like the most and then use that to write your app.
Ruby, Python, Perl all have GUI tool kits available to them. Most of them have access to the same often used tool kits like TK, GTK, and Wx. The lo... | 0 | 1 | 0 | 1 | 2010-01-14T22:03:00.000 | 7 | 0.057081 | false | 2,067,907 | 0 | 0 | 0 | 4 | So I'm aware of the big ammount of general-purpose scripting languages like Ruby, Python, Perl, maybe even PHP, etc. that actually claim being usable for creating desktop applications too.
I think my question can be answered clearly
Are there actually companies using a special scripting language only to create their a... |
"Real" and non-embedded use of Ruby, Python and their friends | 2,068,564 | 1 | 3 | 464 | 0 | python,ruby,perl,scripting | I have used a number of programs that were developed using scripted languages. Several embedded device vendors ship my group Windows-based configuration and debugging utilities written in TCL. Google's drawing program SketchUp has a lot of Ruby inside it (and users can create add-ons using Ruby). I have seen many Li... | 0 | 1 | 0 | 1 | 2010-01-14T22:03:00.000 | 7 | 0.028564 | false | 2,067,907 | 0 | 0 | 0 | 4 | So I'm aware of the big ammount of general-purpose scripting languages like Ruby, Python, Perl, maybe even PHP, etc. that actually claim being usable for creating desktop applications too.
I think my question can be answered clearly
Are there actually companies using a special scripting language only to create their a... |
How would I discover the memory used by an application through a python script? | 2,175,363 | 0 | 1 | 241 | 0 | python,memory-management,windows-7,squish | Remember that Squish allows remote testing of the application. A system parameter queried via Python directly will only apply to the case of local testing.
An approach that works in either case is to call the currentApplicationContext() function that will give you a handle to the Application Under Test. It has a usedMe... | 0 | 1 | 0 | 0 | 2010-01-18T05:30:00.000 | 3 | 0 | false | 2,084,063 | 0 | 0 | 0 | 2 | Recently I've found myself testing an aplication in Froglogic's Squish, using Python to create test scripts. Just the other day, the question of how much memory the program is using has come up, and I've found myself unable to answer it.
It seems reasonable to assume that there's a way to query the os (windows 7) API f... |
How would I discover the memory used by an application through a python script? | 2,084,070 | -1 | 1 | 241 | 0 | python,memory-management,windows-7,squish | In command line: tasklist /FO LIST and parse the results?
Sorry, I don't know a Pythonic way. =P | 0 | 1 | 0 | 0 | 2010-01-18T05:30:00.000 | 3 | -0.066568 | false | 2,084,063 | 0 | 0 | 0 | 2 | Recently I've found myself testing an aplication in Froglogic's Squish, using Python to create test scripts. Just the other day, the question of how much memory the program is using has come up, and I've found myself unable to answer it.
It seems reasonable to assume that there's a way to query the os (windows 7) API f... |
Clear terminal in Python | 2,084,517 | 2 | 241 | 516,293 | 0 | python,terminal | You could tear through the terminfo database, but the functions for doing so are in curses anyway. | 0 | 1 | 0 | 1 | 2010-01-18T07:34:00.000 | 27 | 0.014814 | false | 2,084,508 | 0 | 0 | 0 | 4 | Does any standard "comes with batteries" method exist to clear the terminal screen from a Python script, or do I have to go curses (the libraries, not the words)? |
Clear terminal in Python | 4,808,001 | 0 | 241 | 516,293 | 0 | python,terminal | If all you need is to clear the screen, this is probably good enough. The problem is there's not even a 100% cross platform way of doing this across linux versions. The problem is the implementations of the terminal all support slightly different things. I'm fairly sure that "clear" will work everywhere. But the more "... | 0 | 1 | 0 | 1 | 2010-01-18T07:34:00.000 | 27 | 0 | false | 2,084,508 | 0 | 0 | 0 | 4 | Does any standard "comes with batteries" method exist to clear the terminal screen from a Python script, or do I have to go curses (the libraries, not the words)? |
Clear terminal in Python | 2,084,525 | 2 | 241 | 516,293 | 0 | python,terminal | python -c "from os import system; system('clear')" | 0 | 1 | 0 | 1 | 2010-01-18T07:34:00.000 | 27 | 0.014814 | false | 2,084,508 | 0 | 0 | 0 | 4 | Does any standard "comes with batteries" method exist to clear the terminal screen from a Python script, or do I have to go curses (the libraries, not the words)? |
Clear terminal in Python | 26,639,250 | 108 | 241 | 516,293 | 0 | python,terminal | Why hasn't anyone talked about just simply doing Ctrl+L in Windows or Cmd+L in Mac.
Surely the simplest way of clearing screen. | 0 | 1 | 0 | 1 | 2010-01-18T07:34:00.000 | 27 | 1 | false | 2,084,508 | 0 | 0 | 0 | 4 | Does any standard "comes with batteries" method exist to clear the terminal screen from a Python script, or do I have to go curses (the libraries, not the words)? |
How to deploy highly iterative updates | 2,085,042 | 1 | 0 | 349 | 0 | python,macos,deployment,ubuntu,rsync | to avoid su www I see two easy choices.
make a folder writable to you and readable by www's group in some path that the web-server will be able to serve, then you can rsync to that folder from somewhere on your local machine.
put your public ssh key in www's authorized_keys and rsync to the www user (a bit less securi... | 0 | 1 | 0 | 1 | 2010-01-18T09:25:00.000 | 2 | 0.099668 | false | 2,084,969 | 0 | 0 | 0 | 1 | I have a set of binary assets (swf files) each about 150Kb in size. I am developing them locally on my home computer and I want to periodically deploy them for review. My current strategy is:
Copy the .swf's into a transfer directory that is also a hg (mercurial) repo.
hg push the changes to my slicehost VPN
ssh onto ... |
How can I determine if a python script is executed from crontab? | 2,087,056 | 1 | 5 | 4,167 | 0 | python,unix,terminal,cron | An easier workaround would be to pass a flag to the script only from the crontab, like --crontab, and then just check for that flag. | 0 | 1 | 0 | 1 | 2010-01-18T15:17:00.000 | 6 | 0.033321 | false | 2,086,961 | 0 | 0 | 0 | 4 | I would like to know how can I determine if a python script is executed from crontab?
I don't want a solution that will require adding a parameter because I want to be able to detect this even from an imported module (not the main script). |
How can I determine if a python script is executed from crontab? | 2,087,816 | 0 | 5 | 4,167 | 0 | python,unix,terminal,cron | If you want to detect this from an imported module, I would have the main program set a global variable in the module, which would output different things depending on the value of this global variable (and have the main program decide how to set the variable through a flag that you would use in your crontab). This is... | 0 | 1 | 0 | 1 | 2010-01-18T15:17:00.000 | 6 | 0 | false | 2,086,961 | 0 | 0 | 0 | 4 | I would like to know how can I determine if a python script is executed from crontab?
I don't want a solution that will require adding a parameter because I want to be able to detect this even from an imported module (not the main script). |
How can I determine if a python script is executed from crontab? | 2,087,031 | 21 | 5 | 4,167 | 0 | python,unix,terminal,cron | Not quite what you asked, but maybe what you want is os.isatty(sys.stdout.fileno()), which tells if stdout is connected to (roughly speaking) a terminal. It will be false if you pipe the output to a file or another process, or if the process is run from cron. | 0 | 1 | 0 | 1 | 2010-01-18T15:17:00.000 | 6 | 1.2 | true | 2,086,961 | 0 | 0 | 0 | 4 | I would like to know how can I determine if a python script is executed from crontab?
I don't want a solution that will require adding a parameter because I want to be able to detect this even from an imported module (not the main script). |
How can I determine if a python script is executed from crontab? | 2,087,053 | 5 | 5 | 4,167 | 0 | python,unix,terminal,cron | Set an environment variable at the cron command invocation. That works even within a module, as you can just check os.getenv(). | 0 | 1 | 0 | 1 | 2010-01-18T15:17:00.000 | 6 | 0.16514 | false | 2,086,961 | 0 | 0 | 0 | 4 | I would like to know how can I determine if a python script is executed from crontab?
I don't want a solution that will require adding a parameter because I want to be able to detect this even from an imported module (not the main script). |
How to send a string from a python script at Google App Engine to the browser client as a file | 2,089,653 | 0 | 1 | 180 | 0 | python,html,google-app-engine,mime-types | Setting a content-disposition: attachment header will cause most browsers to download whatever you send them as a file. Safari sometimes ignores it. | 0 | 1 | 0 | 0 | 2010-01-18T22:18:00.000 | 2 | 0 | false | 2,089,635 | 0 | 0 | 1 | 1 | I have a python web-application running inside the Google App Engine.
The application creates on user-demand a string and I want the string to be send to the browser client (application/octet-stream?) as a file.
How can i realize this? |
C++ I/O with Python | 2,093,422 | 2 | 1 | 1,539 | 0 | c++,python | one dirty method:
You can use Python to read (raw_input) from stdin (if there is not input, it will wait). the C++ program writes to stdout. | 0 | 1 | 0 | 0 | 2010-01-19T12:28:00.000 | 4 | 0.099668 | false | 2,093,411 | 1 | 0 | 0 | 2 | I am writing a module in Python which runs a C++ Program using subprocess module. Once I get the output from C++, I need to store the that in Python List . How do I do that ? |
C++ I/O with Python | 2,093,491 | 0 | 1 | 1,539 | 0 | c++,python | In the command for the process you could do a redirect to a temporary file. Then read that file when the process returns. | 0 | 1 | 0 | 0 | 2010-01-19T12:28:00.000 | 4 | 0 | false | 2,093,411 | 1 | 0 | 0 | 2 | I am writing a module in Python which runs a C++ Program using subprocess module. Once I get the output from C++, I need to store the that in Python List . How do I do that ? |
Using Third-Party Modules with Python in an Automator Service | 2,094,638 | 0 | 2 | 2,403 | 0 | python,automator | When you install modules, you typically install them per Python instance. So in this case you have installed them for the Python in /Library/Frameworks/Python.framework/Versions/Current/bin/python, and it will then be available only for that Python. /usr/bin/python is then apparently another Python installation (I'm no... | 0 | 1 | 0 | 1 | 2010-01-19T13:40:00.000 | 2 | 0 | false | 2,093,837 | 1 | 0 | 0 | 1 | I have installed Py-Appscript on my machine and it can be used with the Python installation at /Library/Frameworks/Python.framework/Versions/Current/bin/python.
I am trying to use this installation of Py-Appscript with an Automator service. To do this, I use the Run Shell Script action and then set the Shell to usr/bin... |
Best F/OSS IDE for Python Web Development (Windows or Linux)? | 2,111,703 | 1 | 2 | 1,183 | 0 | python,ide | I am also working with mod_wsgi, python, apache software stack. I am using WingIDE as my environment, which gives you debugging capabilities. If you are vi person it has a VI/VIM personality which coupled with auto-completion makes for a very productive work environment. | 0 | 1 | 0 | 0 | 2010-01-19T21:13:00.000 | 6 | 0.033321 | false | 2,097,134 | 1 | 0 | 0 | 4 | Would like to know what is the best F/OSS IDE for Python Web development. I've always used vim myself, but I'm increasingly interested in having a tool that integrates syntax checking/highlighting, source control, debugging, and other IDE goodies.
I use both Windows and Linux as desktops, so recommendations for either... |
Best F/OSS IDE for Python Web Development (Windows or Linux)? | 2,120,061 | 0 | 2 | 1,183 | 0 | python,ide | What about IDLE? It's bundled with Python distributions. | 0 | 1 | 0 | 0 | 2010-01-19T21:13:00.000 | 6 | 0 | false | 2,097,134 | 1 | 0 | 0 | 4 | Would like to know what is the best F/OSS IDE for Python Web development. I've always used vim myself, but I'm increasingly interested in having a tool that integrates syntax checking/highlighting, source control, debugging, and other IDE goodies.
I use both Windows and Linux as desktops, so recommendations for either... |
Best F/OSS IDE for Python Web Development (Windows or Linux)? | 2,120,241 | 0 | 2 | 1,183 | 0 | python,ide | "syntax checking/highlighting, source control, debugging, and other IDE goodies"
Emacs fits this criteria, if you use the right extensions. Though it does have a much steeper learning curve than any IDE I know of. | 0 | 1 | 0 | 0 | 2010-01-19T21:13:00.000 | 6 | 0 | false | 2,097,134 | 1 | 0 | 0 | 4 | Would like to know what is the best F/OSS IDE for Python Web development. I've always used vim myself, but I'm increasingly interested in having a tool that integrates syntax checking/highlighting, source control, debugging, and other IDE goodies.
I use both Windows and Linux as desktops, so recommendations for either... |
Best F/OSS IDE for Python Web Development (Windows or Linux)? | 2,120,215 | 0 | 2 | 1,183 | 0 | python,ide | I've been using Komodo Edit for a while now and it's quite good for Python development. It's free and I think it's also open-source now, though it wasn't always so. | 0 | 1 | 0 | 0 | 2010-01-19T21:13:00.000 | 6 | 0 | false | 2,097,134 | 1 | 0 | 0 | 4 | Would like to know what is the best F/OSS IDE for Python Web development. I've always used vim myself, but I'm increasingly interested in having a tool that integrates syntax checking/highlighting, source control, debugging, and other IDE goodies.
I use both Windows and Linux as desktops, so recommendations for either... |
How can I keep on-the-fly application-level statistics in an application running under Apache? | 2,113,376 | 1 | 3 | 333 | 0 | python,multithreading,apache,pylons,fork | Perhaps you could keep the relevant counters and other statistics in a memcached, that is accessed by all apache processes? | 0 | 1 | 0 | 0 | 2010-01-21T22:11:00.000 | 3 | 1.2 | true | 2,113,352 | 0 | 0 | 1 | 1 | I have an application running under apache that I want to keep "in the moment" statistics on. I want to have the application tell me things like:
requests per second, broken down by types of request
latency to make requests to various backend services via thrift (broken down by service and server)
number of errors be... |
Determining Whether a Directory is Writeable | 2,113,457 | 78 | 120 | 85,042 | 0 | python,file,permissions,directory,operating-system | It may seem strange to suggest this, but a common Python idiom is
It's easier to ask for forgiveness
than for permission
Following that idiom, one might say:
Try writing to the directory in question, and catch the error if you don't have the permission to do so. | 0 | 1 | 0 | 1 | 2010-01-21T22:24:00.000 | 10 | 1 | false | 2,113,427 | 0 | 0 | 0 | 1 | What would be the best way in Python to determine whether a directory is writeable for the user executing the script? Since this will likely involve using the os module I should mention I'm running it under a *nix environment. |
Why does not the Python MSI installers come with Tcl/Tk header files? | 2,114,635 | 1 | 0 | 511 | 0 | python,tcl,tkinter,header-files,tk | The windows installers don't include ANY source files. Simply because that's how windows apps work. It can be compiled on one computer and it will work on all. So windows versions of things like python and php come precompiled with all options enabled.
If you want the source files you have to download a source tarball ... | 0 | 1 | 0 | 0 | 2010-01-22T02:40:00.000 | 2 | 0.099668 | false | 2,114,615 | 1 | 0 | 0 | 1 | The MSI installers downloadable from python.org does not include Tcl/Tk header (not source) files (that are required to compile some packages like matplotlib). Does anyone know of the rationale behind not including them? |
Python approach to Web Services and/or handeling GET and POST | 2,114,986 | 1 | 2 | 474 | 0 | python,webserver,twisted,tornado | I'd recommend against building your own web server and handling raw socket calls to build web applications; it makes much more sense to just write your web services as wsgi applications and use an existing web server, whether it's something like tornado or apache with mod_wsgi. | 0 | 1 | 1 | 0 | 2010-01-22T04:01:00.000 | 3 | 1.2 | true | 2,114,847 | 0 | 0 | 0 | 1 | I have been working with python for a while now. Recently I got into Sockets with Twisted which was good for learning Telnet, SSH, and Message Passing. I wanted to take an idea and implement it in a web fashion. A week of searching and all I can really do is create a resource that handles GET and POST all to itself. An... |
virtual serial port on Arch linux | 2,648,514 | 3 | 2 | 2,709 | 0 | python | socat command is solution.
First you need to install socat:
pacman -S socat
Just insert this in console, but first you should be login as root:
socat PTY,link=/dev/ttyVirtualS0,echo=0 PTY,link=/dev/ttyVirtualS1,echo=0
and now we have two virtual serial ports which are virtualy connected:
/dev/ttyVirtualS0 <-------> /de... | 0 | 1 | 0 | 0 | 2010-01-22T17:39:00.000 | 1 | 1.2 | true | 2,119,217 | 0 | 0 | 0 | 1 | I am using Arch linux and I need to create virtual serial port on it. I tried everything but it seems doesnt work. All I want is to connect that virtual port to another virtual port over TCP and after that to use it in my python application to communicate with python application to other side. Is that posible? Please h... |
Dynamic terminal printing with python | 2,122,421 | 0 | 57 | 88,169 | 0 | python,terminal | When I do this in shell scripts on Unix, I tend to just use the clear program. You can use the Python subprocess module to execute it. It will at least get you what you're looking for quickly. | 0 | 1 | 0 | 0 | 2010-01-23T06:33:00.000 | 10 | 0 | false | 2,122,385 | 0 | 0 | 0 | 2 | Certain applications like hellanzb have a way of printing to the terminal with the appearance of dynamically refreshing data, kind of like top().
Whats the best method in python for doing this? I have read up on logging and curses, but don't know what to use. I am creating a reimplementation of top. If you have any ... |
Dynamic terminal printing with python | 68,317,499 | 0 | 57 | 88,169 | 0 | python,terminal | I don't think that including another libraries in this situation is really good practice. So, solution:
print("\rCurrent: %s\t%s" % (str(<value>), <another_value>), end="") | 0 | 1 | 0 | 0 | 2010-01-23T06:33:00.000 | 10 | 0 | false | 2,122,385 | 0 | 0 | 0 | 2 | Certain applications like hellanzb have a way of printing to the terminal with the appearance of dynamically refreshing data, kind of like top().
Whats the best method in python for doing this? I have read up on logging and curses, but don't know what to use. I am creating a reimplementation of top. If you have any ... |
Python / Linux/ Daemon process trying to show gtk.messagedialog | 2,124,579 | 3 | 0 | 772 | 0 | python,linux,ubuntu,gtk,daemon | If five users are logged in to X sessions, who gets the message? Everyone?
If someone is logged in locally but only using the tty, and not X11, should they see the message?
If someone is logged in remotely via ssh -X to run a graphic application on their own system off of your CPU, should they see the message? How woul... | 0 | 1 | 0 | 0 | 2010-01-23T19:48:00.000 | 3 | 0.197375 | false | 2,124,455 | 0 | 0 | 0 | 2 | on Ubuntu 8/9,
i'm trying to write a daemon in python, that monitors a certain network condition and informs the user using a gtk.messagedialog.
I installed this script using rc-update.
The daemon starts at boot, but doesn't show the dialog even after I login. I assume because init.d starts my daemon at tty1 and no gn... |
Python / Linux/ Daemon process trying to show gtk.messagedialog | 2,136,615 | 0 | 0 | 772 | 0 | python,linux,ubuntu,gtk,daemon | You may use notify-send (from libnotify-bin package) to send notifications to desktop users from your daemon. | 0 | 1 | 0 | 0 | 2010-01-23T19:48:00.000 | 3 | 0 | false | 2,124,455 | 0 | 0 | 0 | 2 | on Ubuntu 8/9,
i'm trying to write a daemon in python, that monitors a certain network condition and informs the user using a gtk.messagedialog.
I installed this script using rc-update.
The daemon starts at boot, but doesn't show the dialog even after I login. I assume because init.d starts my daemon at tty1 and no gn... |
iPhone app with Google App Engine | 2,124,718 | 2 | 2 | 1,021 | 1 | iphone,python,google-app-engine,gql | True, Google App Engine is a very cool product, but the datastore is a different beast than a regular mySQL database. That's not to say that what you need can't be done with the GAE datastore; however it may take some reworking on your end.
The most prominent different that you notice right off the start is that GAE ... | 0 | 1 | 0 | 0 | 2010-01-23T20:55:00.000 | 4 | 1.2 | true | 2,124,688 | 0 | 0 | 1 | 3 | I've prototyped an iPhone app that uses (internally) SQLite as its data base. The intent was to ultimately have it communicate with a server via PHP, which would use MySQL as the back-end database.
I just discovered Google App Engine, however, but know very little about it. I think it'd be nice to use the Python in... |
iPhone app with Google App Engine | 2,124,705 | 1 | 2 | 1,021 | 1 | iphone,python,google-app-engine,gql | That's a pretty generic question :)
Short answer: yes. It's going to involve some rethinking of your data model, but yes, changes are you can support it with the GAE Datastore API.
When you create your Python models (think of these as tables), you can certainly define references to other models (so now we have a forei... | 0 | 1 | 0 | 0 | 2010-01-23T20:55:00.000 | 4 | 0.049958 | false | 2,124,688 | 0 | 0 | 1 | 3 | I've prototyped an iPhone app that uses (internally) SQLite as its data base. The intent was to ultimately have it communicate with a server via PHP, which would use MySQL as the back-end database.
I just discovered Google App Engine, however, but know very little about it. I think it'd be nice to use the Python in... |
iPhone app with Google App Engine | 2,125,297 | 2 | 2 | 1,021 | 1 | iphone,python,google-app-engine,gql | GQL offers almost no functionality at all; it's only used for SELECT queries, and it only exists to make writing SELECT queries easier for SQL programmers. Behind the scenes, it converts your queries to db.Query objects.
The App Engine datastore isn't a relational database at all. You can do some stuff that looks rel... | 0 | 1 | 0 | 0 | 2010-01-23T20:55:00.000 | 4 | 0.099668 | false | 2,124,688 | 0 | 0 | 1 | 3 | I've prototyped an iPhone app that uses (internally) SQLite as its data base. The intent was to ultimately have it communicate with a server via PHP, which would use MySQL as the back-end database.
I just discovered Google App Engine, however, but know very little about it. I think it'd be nice to use the Python in... |
PID files hanging around for daemons after server restart | 2,134,763 | 3 | 3 | 727 | 0 | python,linux,sigterm | Not a direct solution but it might be a good idea to check for an actual process running with the pid in the pid file at startup and if none exists, to cleanup the stale file.
It's possible that your process is getting a SIGKILL before it has a chance to cleanup the pid file. | 0 | 1 | 0 | 1 | 2010-01-25T18:53:00.000 | 3 | 0.197375 | false | 2,134,732 | 0 | 0 | 0 | 1 | I have some daemons that use PID files to prevent parallel execution of my program. I have set up a signal handler to trap SIGTERM and do the necessary clean-up including the PID file. This works great when I test using "kill -s SIGTERM #PID". However, when I reboot the server the PID files are still hanging around ... |
Named pipe is not flushing in Python | 2,136,921 | 0 | 4 | 4,276 | 0 | python,select,ipc,named-pipes,flush | The flush operation is irrelevant for named pipes; the data for named pipes is held strictly in memory, and won't be released until it is read or the FIFO is closed. | 0 | 1 | 0 | 0 | 2010-01-26T00:40:00.000 | 3 | 0 | false | 2,136,844 | 1 | 0 | 0 | 3 | I have a named pipe created via the os.mkfifo() command. I have two different Python processes accessing this named pipe, process A is reading, and process B is writing. Process A uses the select function to determine when there is data available in the fifo/pipe. Despite the fact that process B flushes after each writ... |
Named pipe is not flushing in Python | 2,200,679 | 1 | 4 | 4,276 | 0 | python,select,ipc,named-pipes,flush | What APIs are you using? os.read() and os.write() don't buffer anything. | 0 | 1 | 0 | 0 | 2010-01-26T00:40:00.000 | 3 | 0.066568 | false | 2,136,844 | 1 | 0 | 0 | 3 | I have a named pipe created via the os.mkfifo() command. I have two different Python processes accessing this named pipe, process A is reading, and process B is writing. Process A uses the select function to determine when there is data available in the fifo/pipe. Despite the fact that process B flushes after each writ... |
Named pipe is not flushing in Python | 2,508,809 | 1 | 4 | 4,276 | 0 | python,select,ipc,named-pipes,flush | To find out if Python's internal buffering is causing your problems, when running your scripts do "python -u" instead of "python". This will force python in to "unbuffered mode" which will cause all output to be printed instantaneously. | 0 | 1 | 0 | 0 | 2010-01-26T00:40:00.000 | 3 | 0.066568 | false | 2,136,844 | 1 | 0 | 0 | 3 | I have a named pipe created via the os.mkfifo() command. I have two different Python processes accessing this named pipe, process A is reading, and process B is writing. Process A uses the select function to determine when there is data available in the fifo/pipe. Despite the fact that process B flushes after each writ... |
Bash or Python or Awk to match and modify files | 2,139,973 | 0 | 1 | 592 | 0 | python,bash,awk | Doing this in Python should be pretty trivial. It's probably possible in awk, but sounds a bit too complicated to be fun. It's surely is possible in bash, but programming in bash is for masochists.
I'd go with Python, of the given options, although Perl and Ruby are good options too if you know them. | 0 | 1 | 0 | 0 | 2010-01-26T14:02:00.000 | 5 | 0 | false | 2,139,823 | 0 | 0 | 0 | 1 | I have a set of 10000 files c1.dat ... c10000.dat. Each of these files contains a line which starts with @ and contains a string with spaces specific for this file, lije c37 7.379 6.23.
I have another set of 10000 files kind of determined_cXXX_send.dat (where XXX goes from 1 to 10000). Each of these files has only one... |
I'm using Hadoop for data processing with python, what file format should be used? | 2,149,550 | 1 | 3 | 1,633 | 0 | python,hadoop | If you're using Hadoop Streaming, your input can be in any line-based format; your mapper and reducer input comes from sys.stdin, which you read any way you want. You don't need to use the default tab-deliminated fields (although in my experience, one format should be used among all tasks for consistency when possible... | 0 | 1 | 0 | 0 | 2010-01-27T02:21:00.000 | 2 | 0.099668 | false | 2,144,171 | 1 | 0 | 0 | 1 | I'm using Hadoop for data processing with python, what file format should be used?
I have project with a substantial amount of text pages.
Each text file has some header information that I need to preserve during the processing; however, I don't want the headers to interfere with the clustering algorithms.
I'm using py... |
How can I run Python code on a windows system? | 2,145,311 | 1 | 2 | 1,021 | 0 | python,windows | You don't say in your question what you are going to use Python for, so most answers above are completely correct in pointing out that you install Python by downloading it from Python.org. But you seem to expect more. Is it correct to assume you are going to use it to do web development?
In that case, prepare for a sho... | 0 | 1 | 0 | 0 | 2010-01-27T07:45:00.000 | 6 | 0.033321 | false | 2,145,232 | 1 | 0 | 0 | 2 | I am used to using PHP and it is easy to set up, I can just run an exe package like Xampp and have apache and PHP running in 5 minutes on my windows system. Is there something similar to Python? |
How can I run Python code on a windows system? | 2,145,253 | 0 | 2 | 1,021 | 0 | python,windows | Download python installer and run python. | 0 | 1 | 0 | 0 | 2010-01-27T07:45:00.000 | 6 | 0 | false | 2,145,232 | 1 | 0 | 0 | 2 | I am used to using PHP and it is easy to set up, I can just run an exe package like Xampp and have apache and PHP running in 5 minutes on my windows system. Is there something similar to Python? |
When running a python script in IDLE, is there a way to pass in command line arguments (args)? | 65,991,396 | 1 | 44 | 83,523 | 0 | python,command-line-arguments,python-idle | IDLE now has a GUI way to add arguments to sys.argv! Under the 'Run' menu header select 'Run... Customized' or just Shift+F5...A dialog will appear and that's it! | 0 | 1 | 0 | 0 | 2010-01-27T17:33:00.000 | 12 | 0.016665 | false | 2,148,994 | 1 | 0 | 0 | 3 | I'm testing some python code that parses command line input. Is there a way to pass this input in through IDLE? Currently I'm saving in the IDLE editor and running from a command prompt.
I'm running Windows. |
When running a python script in IDLE, is there a way to pass in command line arguments (args)? | 33,057,011 | 1 | 44 | 83,523 | 0 | python,command-line-arguments,python-idle | Visual Studio 2015 has an addon for Python. You can supply arguments with that. VS 2015 is now free. | 0 | 1 | 0 | 0 | 2010-01-27T17:33:00.000 | 12 | 0.016665 | false | 2,148,994 | 1 | 0 | 0 | 3 | I'm testing some python code that parses command line input. Is there a way to pass this input in through IDLE? Currently I'm saving in the IDLE editor and running from a command prompt.
I'm running Windows. |
When running a python script in IDLE, is there a way to pass in command line arguments (args)? | 54,038,733 | 0 | 44 | 83,523 | 0 | python,command-line-arguments,python-idle | import sys
sys.argv = [sys.argv[0], '-arg1', 'val1', '-arg2', 'val2']
//If you're passing command line for 'help' or 'verbose' you can say as:
sys.argv = [sys.argv[0], '-h'] | 0 | 1 | 0 | 0 | 2010-01-27T17:33:00.000 | 12 | 0 | false | 2,148,994 | 1 | 0 | 0 | 3 | I'm testing some python code that parses command line input. Is there a way to pass this input in through IDLE? Currently I'm saving in the IDLE editor and running from a command prompt.
I'm running Windows. |
Change process name of Python script | 2,155,073 | 1 | 11 | 5,268 | 0 | python,windows,process | You could use py2exe to turn your Python program into a self-contained executable with whatever name that you choose to give it. | 0 | 1 | 0 | 0 | 2010-01-28T14:11:00.000 | 2 | 0.099668 | false | 2,155,042 | 1 | 0 | 0 | 1 | Windows Task Manager lists all running processes in the "Processes" tab.
The image name of Python scripts is always python.exe, or pythonw.exe, or the name of the Python interpreter.
Is there a nice way to change the image name of a Python script, other than changing the name of the Python interpreter? |
wxPython autocomplete | 2,159,924 | -1 | 0 | 1,719 | 0 | python,ide,editor,autocomplete,wxpython | try use brain to autocomplete... :)
just joking. when I coding in in PyQt4, I open qt-assistant and search the manual,
and wrap myclass like : MyButton = QPusuButton
I think it is impossible to use autocomplete in python,
because only in runtime the computer know what happens. | 0 | 1 | 0 | 0 | 2010-01-29T04:38:00.000 | 8 | -0.024995 | false | 2,159,901 | 0 | 0 | 0 | 4 | What editors or IDEs offer decent autocompletion for wxPython on Windows or Linux? Are there any? I tried several and support is either non-existant or limited. |
wxPython autocomplete | 2,160,186 | 0 | 0 | 1,719 | 0 | python,ide,editor,autocomplete,wxpython | Whatever the default windows IDE for Python is can autocomplete, with code not from the standard library. | 0 | 1 | 0 | 0 | 2010-01-29T04:38:00.000 | 8 | 0 | false | 2,159,901 | 0 | 0 | 0 | 4 | What editors or IDEs offer decent autocompletion for wxPython on Windows or Linux? Are there any? I tried several and support is either non-existant or limited. |
wxPython autocomplete | 2,160,555 | 1 | 0 | 1,719 | 0 | python,ide,editor,autocomplete,wxpython | I use Eclipse/PyDev for wxPython development. I've been very satisfied with Eclipse for Python development productivity. It does have support for autocompletion for wxPython. | 0 | 1 | 0 | 0 | 2010-01-29T04:38:00.000 | 8 | 0.024995 | false | 2,159,901 | 0 | 0 | 0 | 4 | What editors or IDEs offer decent autocompletion for wxPython on Windows or Linux? Are there any? I tried several and support is either non-existant or limited. |
wxPython autocomplete | 31,372,616 | 1 | 0 | 1,719 | 0 | python,ide,editor,autocomplete,wxpython | I'm partial to PyCharm. However, most IDEs will auto complete code based on what modules you've imported, so it's not specific to PyCharm. | 0 | 1 | 0 | 0 | 2010-01-29T04:38:00.000 | 8 | 0.024995 | false | 2,159,901 | 0 | 0 | 0 | 4 | What editors or IDEs offer decent autocompletion for wxPython on Windows or Linux? Are there any? I tried several and support is either non-existant or limited. |
Can access AppEngine SDK sites via local ip-address when localhost works just fine and a MacOSX | 29,235,036 | 0 | 10 | 6,718 | 0 | python,google-app-engine,facebook,macos | In Android Studio with Google App Engine plugin.
Just add httpAddress = '0.0.0.0' to app cfg in build.grade file. | 0 | 1 | 0 | 0 | 2010-01-30T15:47:00.000 | 5 | 0 | false | 2,168,409 | 0 | 0 | 1 | 1 | Can access AppEngine SDK sites via local ip-address when localhost works just fine and a MacOSX using the GoogleAppEngineLauncher.
I'm trying to setup facebook development site (using a dyndns.org hostname pointing at my firewall which redirects the call to my mac book).
It seems like GoogleAppEngineLauncher defaults t... |
python how to -generate license- using time module | 2,171,940 | 0 | 2 | 1,108 | 0 | python,datetime,time,licensing | Nearly every standard function will return the machine time that can be adjusted by the user.
One possibility is to call a web service that returns the "correct" time. But this is only possible if you can assume internet access.
And may be should ask your self the question if that hassle is really worth the effort? | 0 | 1 | 0 | 0 | 2010-01-31T13:58:00.000 | 3 | 0 | false | 2,171,902 | 0 | 0 | 0 | 1 | I'm searching for a way to generate a (limited time license) .so
when a user starts the program . it has to check license date first before the program runs.
but the problem is :
i tried a couple of solutions . one of them is python's time.ctime , (to check time and see if it's realy during the license time) and it ret... |
How can I grap resident set size from Python on Solaris? | 2,193,909 | 0 | 1 | 479 | 0 | python,solaris,getrusage | Well...you can pull it from the pmap application by calling pmap -x. But I was looking more for a way to access the info directly in /proc from my app. The only way to do it is to access the /proc/<pid>/xmap file. Unfortunately, the data is stored as an array of prxmap structs...so either a Python C-module is in order... | 0 | 1 | 0 | 1 | 2010-02-01T21:17:00.000 | 2 | 0 | false | 2,180,156 | 0 | 0 | 0 | 1 | Calling resource.getrusage() from Python returns a 0 value for resident set size on Solaris and Linux systems. On Linux you can pull the RSS From /proc//status instead. Does anybody have a good way to pull RSS on Solaris, either similar or not to the Linux workaround? |
Pylons and Flex 3 | 2,258,476 | 0 | 0 | 251 | 0 | python,apache-flex,pylons,twisted | I'm working on webapp which has client-side UI coded in Flex 3 and backend is Pylons app. Our client communicates with backend using HTTP GET and POST requests, POST request bodies and all response bodies carry data in JSON format. Works well, just few gotchas:
Flex apps cannot do PUT and DELETE requests. We work arou... | 0 | 1 | 0 | 0 | 2010-02-02T15:45:00.000 | 1 | 0 | false | 2,185,329 | 0 | 0 | 1 | 1 | Has anyone used Python/Pylons as the server backend for a Flex 3 application? Does anyone have any thoughts on how well this would work? I read Bruce Eckel's article about tying Flex 3 to Twisted, and I've done Twisted programming, but for just a web service I think Pylons is simpler to use.
Thanks in advance,
Doug |
Need a way to count entities in GAE datastore that meet a certain condition? (over 1000 entities) | 4,088,516 | 3 | 4 | 4,016 | 0 | python,google-app-engine,google-cloud-datastore | Results of datastore count() queries
and offsets for all datastore queries
are no longer capped at 1000.
Since Version 1.3.6 | 0 | 1 | 0 | 0 | 2010-02-04T17:02:00.000 | 6 | 0.099668 | false | 2,201,580 | 0 | 0 | 1 | 1 | I'm building an app on GAE that needs to report on events occurring. An event has a type and I also need to report by event type.
For example, say there is an event A, B and C. They occur periodically at random. User logs in and creates a set of entities to which those events can be attributed. When the user comes back... |
Code Changes While Keeping Large Objects In Memory in Python | 2,203,707 | 0 | 2 | 128 | 0 | python | The usual problem with reload is that instances stay bound to the old version of the class. If you are not keeping old instances around, reload is simple and works very well. | 0 | 1 | 0 | 0 | 2010-02-04T21:49:00.000 | 2 | 0 | false | 2,203,492 | 1 | 0 | 0 | 1 | I have an application that starts by loading a large pickled trie (173M) from disk and then uses it to do some processing. I'm making frequent changes to the processing part, which is inconvenient because loading the trie takes 15 minutes or so. I'm looking for a way to eliminate the repeated loading during testing, ... |
Minimal linear regression program | 2,204,122 | 1 | 2 | 2,428 | 0 | c++,python,bash,linear-algebra | How about extracting the coeffs into a file, import to another machine and then use Excel/Matlab/whatever other program that does this for you? | 0 | 1 | 0 | 0 | 2010-02-04T23:45:00.000 | 3 | 0.066568 | false | 2,204,087 | 0 | 1 | 0 | 2 | I am running some calculations in an external machine and at the end I get X, Y pairs. I want to apply linear regression and obtain A, B, and R2. In this machine I can not install anything (it runs Linux) and has basic stuff installed on it, python, bash (of course), etc.
I wonder what would be the best approach to use... |
Minimal linear regression program | 2,204,124 | 3 | 2 | 2,428 | 0 | c++,python,bash,linear-algebra | For a single, simple, known function (as in your case: a line) it is not hard to simply code a basic least square routine from scratch (but does require some attention to detail). It is a very common assignment in introductory numeric analysis classes.
So, look up least squares on wikipedia or mathworld or in a text bo... | 0 | 1 | 0 | 0 | 2010-02-04T23:45:00.000 | 3 | 0.197375 | false | 2,204,087 | 0 | 1 | 0 | 2 | I am running some calculations in an external machine and at the end I get X, Y pairs. I want to apply linear regression and obtain A, B, and R2. In this machine I can not install anything (it runs Linux) and has basic stuff installed on it, python, bash (of course), etc.
I wonder what would be the best approach to use... |
Detect 64bit OS (windows) in Python | 3,740,665 | 6 | 41 | 46,662 | 0 | python,windows,64-bit | Many of these proposed solutions, such as platform.architecture(), fail because their results depend on whether you are running 32-bit or 64-bit Python.
The only reliable method I have found is to check for the existence of os.environ['PROGRAMFILES(X86)'], which is unfortunately hackish. | 0 | 1 | 0 | 0 | 2010-02-05T16:55:00.000 | 22 | 1 | false | 2,208,828 | 1 | 0 | 0 | 4 | Does anyone know how I would go about detected what bit version Windows is under Python. I need to know this as a way of using the right folder for Program Files.
Many thanks |
Detect 64bit OS (windows) in Python | 2,208,869 | 38 | 41 | 46,662 | 0 | python,windows,64-bit | I guess you should look in os.environ['PROGRAMFILES'] for the program files folder. | 0 | 1 | 0 | 0 | 2010-02-05T16:55:00.000 | 22 | 1 | false | 2,208,828 | 1 | 0 | 0 | 4 | Does anyone know how I would go about detected what bit version Windows is under Python. I need to know this as a way of using the right folder for Program Files.
Many thanks |
Detect 64bit OS (windows) in Python | 2,208,946 | -2 | 41 | 46,662 | 0 | python,windows,64-bit | There should be a directory under Windows 64bit, a Folder called \Windows\WinSxS64 for 64 bit, under Windows 32bit, it's WinSxS. | 0 | 1 | 0 | 0 | 2010-02-05T16:55:00.000 | 22 | -0.01818 | false | 2,208,828 | 1 | 0 | 0 | 4 | Does anyone know how I would go about detected what bit version Windows is under Python. I need to know this as a way of using the right folder for Program Files.
Many thanks |
Detect 64bit OS (windows) in Python | 2,209,113 | 3 | 41 | 46,662 | 0 | python,windows,64-bit | You should be using environment variables to access this. The program files directory is stored in the environment variable PROGRAMFILES on x86 Windows, the 32-bit program files is directory is stored in the PROGRAMFILES(X86) environment variable, these can be accessed by using os.environ('PROGRAMFILES').
Use sys.getwi... | 0 | 1 | 0 | 0 | 2010-02-05T16:55:00.000 | 22 | 0.027266 | false | 2,208,828 | 1 | 0 | 0 | 4 | Does anyone know how I would go about detected what bit version Windows is under Python. I need to know this as a way of using the right folder for Program Files.
Many thanks |
Disassembling with python - no easy solution? | 2,217,220 | 2 | 7 | 1,298 | 0 | python,swig,disassembly | Well, after much meddling around, I managed to compile SWIGed libdisasm!
Unfortunately, it seems to crash python on incorrect (and sometimes correct) usage.
How I did it:
I compiled libdisasm.lib using Visual Studio 6, the only thing you need for this is the source code in whichever libdisasm release you use, and std... | 0 | 1 | 0 | 0 | 2010-02-07T13:02:00.000 | 4 | 0.099668 | false | 2,216,816 | 1 | 0 | 0 | 1 | I'm trying to create a python script that will disassemble a binary (a Windows exe to be precise) and analyze its code.
I need the ability to take a certain buffer, and extract some sort of struct containing information about the instructions in it.
I've worked with libdisasm in C before, and I found it's interface qui... |
RSS Feed aggregator using Google App Engine - Python | 2,253,676 | 1 | 4 | 3,392 | 0 | python,rss,feed | I found a way to work around this issue, though I am not sure if this is the optimal solution.
Instead of Minidom I have used cElementTree to parse the RSS feed. I process each "item" tag and its children in a seperate task and add these tasks to the task queue.
This has helped me avoid the DeadlineExceededError. I ge... | 0 | 1 | 0 | 0 | 2010-02-08T19:20:00.000 | 3 | 0.066568 | false | 2,224,219 | 0 | 0 | 1 | 1 | I am trying to build a GAE app that processes an RSS feed and stores all the data from the feed into Google Datastore. I use Minidom to extract content from the RSS feed. I also tried using Feedparser and BeautifulSoup but they did not work for me.
My app currently parses the feed and saves it in the Google datastore ... |
Does anyone know of a Urwid like environment that is cross-platform for Python 3.x? | 2,239,928 | 0 | 0 | 322 | 0 | python,cross-platform,python-3.x | Help port Urwid to Python 3! That is most likely more work that just running 2to3 on it, though. | 0 | 1 | 0 | 0 | 2010-02-09T05:18:00.000 | 3 | 0 | false | 2,226,913 | 0 | 0 | 1 | 1 | I would like it to run on Linux, OS X, and Windows (XP/Vista/7).
Thanks for any input. |
Can I port my existing python apps on ASE? | 2,233,946 | 4 | 8 | 901 | 0 | python,android,ase,android-scripting | As of yet, there is no support for a gui on ASE apart from some simple input and display dialogs. Look at /sdcard/ase/extras/python to find libraries already available. You can add new libraries by copying them there. | 0 | 1 | 0 | 0 | 2010-02-10T00:44:00.000 | 1 | 1.2 | true | 2,233,631 | 1 | 0 | 0 | 1 | I learned that the Android Scripting Environment (ASE) supports python code. Can I take my existing python programs and run them on android?
Apart from the GUI, what else will I need to adapt? How can I find the list of supported python libraries for ASE? |
How to send file to serial port using kermit protocol in python | 3,143,184 | 0 | 2 | 3,905 | 0 | python,serial-port,pyserial,kermit | You should be able to do it via the subprocess module. The following assumes that you can send commands to your remote machine and parse out the results already. :-)
I don't have anything to test this on at the moment, so I'm going to be pretty general.
Roughly:
1.) use pyserial to connect to the remote system throu... | 0 | 1 | 0 | 1 | 2010-02-10T14:31:00.000 | 1 | 1.2 | true | 2,237,483 | 0 | 0 | 0 | 1 | I have device connected through serial port to PC. Using c-kermit I can send commands to device and read output. I can also send files using kermit protocol.
In python we have pretty nice library - pySerial. I can use it to send/receive data from device. But is there some nice solution to send files using kermit protoc... |
Declare which signals are subscribed to on DBus? | 2,389,202 | 4 | 3 | 580 | 0 | python,dbus | D-Bus clients call AddMatch on the bus daemon to register their interest in messages matching a particular pattern; most bindings add a match rule either for all signals on a particular service and object path, or for signals on a particular interface on that service and object path, when you create a proxy object.
Usi... | 0 | 1 | 0 | 0 | 2010-02-10T21:42:00.000 | 2 | 0.379949 | false | 2,240,562 | 0 | 0 | 0 | 2 | Is there a way to declare which signals are subscribed by a Python application over DBus?
In other words, is there a way to advertise through the "Introspectable" interface which signals are subscribed to. I use "D-Feet D-Bus debugger".
E.g. Application subscribes to signal X (using the add_signal_receiver method on a... |
Declare which signals are subscribed to on DBus? | 2,364,175 | 1 | 3 | 580 | 0 | python,dbus | This is probably not possible since a signal is emitted on the bus and the application just picks out what is interesting. Subscribing is not happening inside dbus. | 0 | 1 | 0 | 0 | 2010-02-10T21:42:00.000 | 2 | 1.2 | true | 2,240,562 | 0 | 0 | 0 | 2 | Is there a way to declare which signals are subscribed by a Python application over DBus?
In other words, is there a way to advertise through the "Introspectable" interface which signals are subscribed to. I use "D-Feet D-Bus debugger".
E.g. Application subscribes to signal X (using the add_signal_receiver method on a... |
Location to put user configuration files in windows | 2,243,910 | 12 | 13 | 7,044 | 0 | python,windows,configuration,configuration-files | %APPDATA% is the right place for these (probably in a subdirectory for your library). Unfortunately a fair number of *nix apps ported to Windows don't respect that and I end up with .gem, .ssh, .VirtualBox, etc., folders cluttering up my home directory and not hidden by default as on *nix.
You can make it easy even for... | 0 | 1 | 0 | 0 | 2010-02-11T10:48:00.000 | 3 | 1.2 | true | 2,243,895 | 1 | 0 | 0 | 2 | I'm writing a python library that has a per-user configuration file that can be edited by the user of the library. The library also generates logging files.
On *nix, the standard seems to be to dump them in $HOME/.library_name.
However, I am not sure what to do with Windows users. I've used windows for years before... |
Location to put user configuration files in windows | 2,243,919 | 1 | 13 | 7,044 | 0 | python,windows,configuration,configuration-files | On windows the user is not expected to configure an application using editable config files so there is no standard.
The standard for configuration which is editable using a GUI is the registry.
If you're using QT (or PyQT?) then you can use QSettings which provide an abstraction layer. On Linux it uses a config file a... | 0 | 1 | 0 | 0 | 2010-02-11T10:48:00.000 | 3 | 0.066568 | false | 2,243,895 | 1 | 0 | 0 | 2 | I'm writing a python library that has a per-user configuration file that can be edited by the user of the library. The library also generates logging files.
On *nix, the standard seems to be to dump them in $HOME/.library_name.
However, I am not sure what to do with Windows users. I've used windows for years before... |
Python Fabric: How to answer to keyboard input? | 2,246,509 | 1 | 24 | 13,991 | 0 | python,automation,fabric | Those both methods are valid and works.
I choose the first one, because I didn't want to have any interaction with my deployment system.
So here is the solution I used:
% yes | ./manage.py rebuild_index
WARNING: This will irreparably remove EVERYTHING from your search index.
Your choices after this are to restore fro... | 0 | 1 | 0 | 0 | 2010-02-11T17:26:00.000 | 6 | 0.033321 | false | 2,246,256 | 0 | 0 | 0 | 1 | I would like to automate the response for some question prompted by some programs, like mysql prompting for a password, or apt asking for a 'yes' or ... when I want to rebuild my haystack index with a ./manage.py rebuild_index.
For MySQL, I can use the --password= switch, and I'm sure that apt has a 'quiet' like optio... |
How to improve the throughput of request_logs on Google App Engine | 2,249,540 | 1 | 1 | 499 | 0 | python,google-app-engine,logging | You can increase the per-request batch size of logs. In the latest SDK (1.3.1), check out google_appengine/google/appengine/tools/appcfg.py around like 861 (RequestLogLines method of LogsRequester class). You can modify the "limit" parameter.
I am using 1000 and it works pretty well. | 0 | 1 | 0 | 0 | 2010-02-12T03:40:00.000 | 1 | 1.2 | true | 2,249,530 | 0 | 0 | 1 | 1 | Downloading logs from App Engine is nontrivial. Requests are batched; appcfg.py does not use normal file IO but rather a temporary file (in reverse chronological order) which it ultimately appends to the local log file; when appending, the need to find the "sentinel" makes log rotation difficult since one must leave en... |
Running script on server start in google app engine, in Python | 2,253,428 | 4 | 5 | 2,804 | 0 | python,google-app-engine | I use appengine python with the django helper. As far as I know you cannot hook anything on the deploy, but you could put a call to check if you need to do your setup in the main function of main.py. This is how the helper initializes itself on the first request. I haven't looked at webapp in a while, but I assume m... | 0 | 1 | 0 | 0 | 2010-02-12T15:03:00.000 | 4 | 1.2 | true | 2,252,672 | 0 | 0 | 1 | 3 | Is it possible to run a script each time the dev server starts? Also at each deploy to google?
I want the application to fill the database based on what some methods returns.
Is there any way to do this?
..fredrik |
Running script on server start in google app engine, in Python | 2,252,697 | 2 | 5 | 2,804 | 0 | python,google-app-engine | You can do this by writing a script in your favorite scripting language that performs the actions that you desire and then runs the dev server or runs appcfg.py update. | 0 | 1 | 0 | 0 | 2010-02-12T15:03:00.000 | 4 | 0.099668 | false | 2,252,672 | 0 | 0 | 1 | 3 | Is it possible to run a script each time the dev server starts? Also at each deploy to google?
I want the application to fill the database based on what some methods returns.
Is there any way to do this?
..fredrik |
Running script on server start in google app engine, in Python | 2,259,561 | 1 | 5 | 2,804 | 0 | python,google-app-engine | Try to make wrapper around the server runner and script that run deployment. So you will be able to run custom code when you need. | 0 | 1 | 0 | 0 | 2010-02-12T15:03:00.000 | 4 | 0.049958 | false | 2,252,672 | 0 | 0 | 1 | 3 | Is it possible to run a script each time the dev server starts? Also at each deploy to google?
I want the application to fill the database based on what some methods returns.
Is there any way to do this?
..fredrik |
Sharing scripts that require a virtualenv to be activated | 2,254,286 | -1 | 40 | 12,524 | 0 | python,virtualenv | If it's only on one server, then flexibility is irrelevant. Modify the shebang. If you're worried about that, make a packaged, installed copy on the dev server that doesn't use the virtualenv. Once it's out of develepment, whether that's for local users or users in guatemala, virtualenv is no longer the right tool. | 0 | 1 | 0 | 0 | 2010-02-12T17:22:00.000 | 3 | 1.2 | true | 2,253,712 | 1 | 0 | 0 | 2 | I have virtualenv and virtualenvwrapper installed on a shared Linux server with default settings (virtualenvs are in ~/.virtualenvs). I have several Python scripts that can only be run when the correct virtualenv is activated.
Now I want to share those scripts with other users on the server, but without requiring them... |
Sharing scripts that require a virtualenv to be activated | 2,253,847 | 6 | 40 | 12,524 | 0 | python,virtualenv | I would vote for adding a shebang line in scriptname pointing to the correct virtualenv python. You just tell your users the full path to scriptname (or put it in their PATH), and they don't even need to know it is a Python script.
If your users are programmers, then I don't see why you wouldn't want them to know/learn... | 0 | 1 | 0 | 0 | 2010-02-12T17:22:00.000 | 3 | 1 | false | 2,253,712 | 1 | 0 | 0 | 2 | I have virtualenv and virtualenvwrapper installed on a shared Linux server with default settings (virtualenvs are in ~/.virtualenvs). I have several Python scripts that can only be run when the correct virtualenv is activated.
Now I want to share those scripts with other users on the server, but without requiring them... |
changing the process name of a python script | 18,992,161 | 8 | 26 | 26,676 | 0 | python,linux | the procname library didn't work for me on ubuntu. I went with setproctitle instead (pip install setproctitle). This is what gunicorn uses and it worked for me. | 0 | 1 | 0 | 0 | 2010-02-12T22:08:00.000 | 4 | 1 | false | 2,255,444 | 0 | 0 | 0 | 1 | Is there a way to change the name of a process running a python script on Linux?
When I do a ps, all I get are "python" process names. |
How do I interact with MATLAB from Python? | 2,257,221 | 1 | 24 | 23,758 | 0 | python,matlab,ctypes | Regarding OS compatibility, if you use the matlab version for Linux, the scripts written in windows should work without any changes.
If possible, you may also consider the possibility of doing everything with python. Scipy/numpy with Matplotlib provide a complete Matlab replacement. | 0 | 1 | 0 | 1 | 2010-02-13T00:12:00.000 | 4 | 0.049958 | false | 2,255,942 | 0 | 0 | 0 | 1 | A friend asked me about creating a small web interface that accepts some inputs, sends them to MATLAB for number crunching and outputs the results. I'm a Python/Django developer by trade, so I can handle the web interface, but I am clueless when it comes to MATLAB. Specifically:
I'd really like to avoid hosting this o... |
Recommended Django Deployment | 2,257,323 | 4 | 9 | 3,882 | 0 | python,linux,django,deployment,webserver | Update your question to remove the choices that don't work. If it has Python 2.4, and an installation is a headache, just take it off the list, and update the question to list the real candidates. Only list the ones that actually fit your requirements. (You don't say what your requirements are, but minimal upgrades ... | 0 | 1 | 0 | 0 | 2010-02-13T08:47:00.000 | 4 | 0.197375 | false | 2,256,987 | 0 | 0 | 1 | 3 | Short version: How do you deploy your Django servers? What application server, front-end (if any, and by front-end I mean reverse proxy), and OS do you run it on? Any input would be greatly appreciated, I'm quite a novice when it comes to Python and even more as a server administrator.
Long version:
I'm migrating betwe... |
Recommended Django Deployment | 2,257,450 | 3 | 9 | 3,882 | 0 | python,linux,django,deployment,webserver | At the place I rent server, they have shaved down the Ubuntu images to bare minimum. Presumably because they had to make a special image anyway with just the right drivers and such in it, but I don't know exactly.
They have even removed wget and nano. So you get all the apt-get goodness and not a whole lot of "cookie-c... | 0 | 1 | 0 | 0 | 2010-02-13T08:47:00.000 | 4 | 0.148885 | false | 2,256,987 | 0 | 0 | 1 | 3 | Short version: How do you deploy your Django servers? What application server, front-end (if any, and by front-end I mean reverse proxy), and OS do you run it on? Any input would be greatly appreciated, I'm quite a novice when it comes to Python and even more as a server administrator.
Long version:
I'm migrating betwe... |
Recommended Django Deployment | 2,259,882 | 0 | 9 | 3,882 | 0 | python,linux,django,deployment,webserver | Personally I find one of the BSD systems far superior to Linux distros for server related tasks. Give OpenBSD or perhaps FreeBSD a chance. Once you do you´ll never go back. | 0 | 1 | 0 | 0 | 2010-02-13T08:47:00.000 | 4 | 0 | false | 2,256,987 | 0 | 0 | 1 | 3 | Short version: How do you deploy your Django servers? What application server, front-end (if any, and by front-end I mean reverse proxy), and OS do you run it on? Any input would be greatly appreciated, I'm quite a novice when it comes to Python and even more as a server administrator.
Long version:
I'm migrating betwe... |
How do I do os.getpid() in C++? | 2,257,431 | 0 | 0 | 862 | 0 | c++,python | You cannot easily retrieve the Python interpreter's PID from your C++ program.
Either assign the named pipe a constant name, or if you really need multiple pipes of the same Python program, create a temporary file to which the Python programs write their PIDs (use file locking!) - then you can read the PIDs from the C+... | 0 | 1 | 0 | 1 | 2010-02-13T12:09:00.000 | 4 | 0 | false | 2,257,415 | 0 | 0 | 0 | 4 | newb here. I am trying to make a c++ program that will read from a named pipe created by python. My problem is, the named pipe created by python uses os.getpid() as part of the pipe name. when i try calling the pipe from c++, i use getpid(). i am not getting the same value from c++. is there a method equivalent in c++ ... |
How do I do os.getpid() in C++? | 2,257,426 | 2 | 0 | 862 | 0 | c++,python | You won't get the same value if you're running as a separate process as each process has their own process ID. Find some other way to identify the pipe. | 0 | 1 | 0 | 1 | 2010-02-13T12:09:00.000 | 4 | 0.099668 | false | 2,257,415 | 0 | 0 | 0 | 4 | newb here. I am trying to make a c++ program that will read from a named pipe created by python. My problem is, the named pipe created by python uses os.getpid() as part of the pipe name. when i try calling the pipe from c++, i use getpid(). i am not getting the same value from c++. is there a method equivalent in c++ ... |
How do I do os.getpid() in C++? | 2,257,422 | 4 | 0 | 862 | 0 | c++,python | You don't get same proccess IDs because your python program and c++ programs are run in different proccesses thus having different process IDs. So generally use a different logic to name your fifo files. | 0 | 1 | 0 | 1 | 2010-02-13T12:09:00.000 | 4 | 0.197375 | false | 2,257,415 | 0 | 0 | 0 | 4 | newb here. I am trying to make a c++ program that will read from a named pipe created by python. My problem is, the named pipe created by python uses os.getpid() as part of the pipe name. when i try calling the pipe from c++, i use getpid(). i am not getting the same value from c++. is there a method equivalent in c++ ... |
How do I do os.getpid() in C++? | 2,257,420 | 0 | 0 | 862 | 0 | c++,python | The standard library does not give you anything other than files. You will need to use some other OS specific API. | 0 | 1 | 0 | 1 | 2010-02-13T12:09:00.000 | 4 | 0 | false | 2,257,415 | 0 | 0 | 0 | 4 | newb here. I am trying to make a c++ program that will read from a named pipe created by python. My problem is, the named pipe created by python uses os.getpid() as part of the pipe name. when i try calling the pipe from c++, i use getpid(). i am not getting the same value from c++. is there a method equivalent in c++ ... |
How can I detect what other copy of Python script is already running | 2,262,290 | 3 | 2 | 648 | 0 | python | You could use a D-Bus service. Your script would start a new service if none is found running in the current session, and otherwise send a D-Bus message to the running instace (that can send "anything", including strings, lists, dicts).
The GTK-based library libunique (missing Python bindings?) uses this approach in it... | 0 | 1 | 0 | 0 | 2010-02-14T17:30:00.000 | 4 | 0.148885 | false | 2,261,997 | 0 | 0 | 0 | 1 | I have a script. It uses GTK. And I need to know if another copy of scrip starts. If it starts window will extend.
Please, tell me the way I can detect it. |
What mutex/locking/waiting mechanism to use when writing a Chat application with Tornado Web Framework | 2,795,094 | 0 | 0 | 791 | 0 | python,asynchronous,tornado | Tornado has a "chat" example which uses long polling. It contains everything you need (or actually, probably more than you need since it includes a 3rd-party login) | 0 | 1 | 0 | 0 | 2010-02-14T17:39:00.000 | 2 | 0 | false | 2,262,039 | 0 | 0 | 0 | 1 | We're implementing a Chat server using Tornado.
The premise is simple, a user makes open an HTTP ajax connection to the Tornado server, and the Tornado server answers only when a new message appears in the chat-room. Whenever the connection closes, regardless if a new message came in or an error/timeout occurred, the c... |
How to read from stdin or from a file if no data is piped in Python? | 2,265,010 | 3 | 20 | 10,274 | 0 | python,pipe,stdin,command-line-interface | There is no reliable way to detect if sys.stdin is connected to anything, nor is it appropriate do so (e.g., the user wants to paste the data in). Detect the presence of a filename as an argument, and use stdin if none is found. | 0 | 1 | 0 | 0 | 2010-02-15T09:42:00.000 | 6 | 0.099668 | false | 2,264,991 | 0 | 0 | 0 | 1 | I have a CLI script and want it to read data from a file. It should be able to read it in two ways :
cat data.txt | ./my_script.py
./my_script.py data.txt
—a bit like grep, for example.
What I know:
sys.argv and optparse let me read any args and options easily.
sys.stdin let me read data piped in
fileinput make the ... |
Path of current Python instance? | 2,276,543 | 0 | 1 | 590 | 0 | python,windows,installation,path,python-3.x | Hmm, find the Lib dir from sys.path and extrapolate from there? | 0 | 1 | 0 | 1 | 2010-02-16T21:31:00.000 | 2 | 0 | false | 2,276,512 | 1 | 0 | 0 | 1 | I need to access the Scripts and tcl sub-directories of the currently executing Python instance's installation directory on Windows.
What is the best way to locate these directories? |
How can I keep a Python script command window open when opened from a .Net application? | 7,886,740 | 0 | 1 | 797 | 0 | c#,python,command-line | I had a similar issue, I solved it by adding raw_input() at the end of the script.
Even if it's not using the value the script should hold before quitting as it waits for input from the command line.
Sadly this doesn't help if the script errors out before it reaches the raw_input() line, but you'll see how far along i... | 0 | 1 | 0 | 0 | 2010-02-17T00:45:00.000 | 2 | 0 | false | 2,277,571 | 1 | 0 | 0 | 1 | Now the obvious answer is to just open the script from a command line, but that isn't an option. I'm writing a simple application to syntax highlight Python and then run the scripts from the same program. A Python IDE if you will. The scripts I want to run are entirely command line programs.
I'm using a System.Diagn... |
Question regarding UDP communication in twisted framework | 2,278,671 | -1 | 1 | 435 | 0 | python,udp,twisted | Are you sure that it is not a receive problem?
There is no indication that your packets won't be fragmented en route to the destination | 0 | 1 | 0 | 0 | 2010-02-17T06:06:00.000 | 2 | -0.099668 | false | 2,278,665 | 0 | 0 | 0 | 2 | I would like to find out if Twisted imposes restriction on maximum size of UDP packets. The allowable limit on linux platforms is upto 64k (although I intend to send packets of about 10k bytes consisting of JPEG images) but I am not able to send more than approx. 2500 bytes |
Question regarding UDP communication in twisted framework | 2,280,167 | 1 | 1 | 435 | 0 | python,udp,twisted | It's very unlikely that Twisted is imposing any limit but there's no reason some other part of the network wouldn't drop the packets if they're too large. It's very rare for people to send UDP packets of such a large size for precisely that sort of reason. Most game applications for example try to keep them below 1.5K ... | 0 | 1 | 0 | 0 | 2010-02-17T06:06:00.000 | 2 | 0.099668 | false | 2,278,665 | 0 | 0 | 0 | 2 | I would like to find out if Twisted imposes restriction on maximum size of UDP packets. The allowable limit on linux platforms is upto 64k (although I intend to send packets of about 10k bytes consisting of JPEG images) but I am not able to send more than approx. 2500 bytes |
Bash alias to Python script -- is it possible? | 2,301,977 | 0 | 4 | 11,553 | 0 | python,bash,curl,scripting,multiplatform | I thought Pycurl might be the answer. Ahh Daniel Sternberg and his innocent presumptions that everybody knows what he does. I asked on the list whether or not pycurl had a "curl -o" analogue, and then asked 'If so: How would one go about coding it/them in a Python script?' His reply was the following:
"curl.setopt(pycu... | 0 | 1 | 0 | 0 | 2010-02-17T10:11:00.000 | 2 | 0 | false | 2,279,749 | 0 | 0 | 0 | 1 | The particular alias I'm looking to "class up" into a Python script happens to be one that makes use of the cUrl -o (output to file) option. I suppose I could as easily turn it into a BASH function, but someone advised me that I could avoid the quirks and pitfalls of the different versions and "flavors" of BASH by taki... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.