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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Can API hooking in python be OS agnostic? | 11,639,758 | 2 | 6 | 6,564 | 0 | python,python-3.x | In Python things like this is generally so trivial that it's hard to even provide examples. Hooks are generally callbacks, yes. Callbacks in python are simply done by passing functions around and calling them. | 0 | 1 | 0 | 0 | 2012-07-24T16:38:00.000 | 3 | 0.132549 | false | 11,635,443 | 1 | 0 | 0 | 1 | In the world of penetration testing with Python, it looks like
one has to generally hook into an API that's OS specific. This makes sense
to me because we're dealing with different architectures and kernels between
OSX, Linux, Windows. But I'm wondering if this isn't the case?
Beyond some of the limited functionality ... |
Output of a process displayed in multiple consoles | 11,663,302 | 0 | 0 | 234 | 0 | python,linux,ssh,console | I have seen that indeed screen does what i need...
Thanks Ignacio | 0 | 1 | 0 | 0 | 2012-07-25T07:35:00.000 | 2 | 1.2 | true | 11,644,808 | 0 | 0 | 0 | 2 | I have a python script that runs continuously in background and print some logs on standard output.
If I log with the same user on the same machine via ssh however I cannot see the output since (I guess) I opened a different shell.
Is there any way to specify that the standard output of this process must be seen by all... |
Output of a process displayed in multiple consoles | 11,645,207 | 0 | 0 | 234 | 0 | python,linux,ssh,console | In UNIX you could write to all shells using the command wall. I'm not sure if there is a Python binding for wall though. | 0 | 1 | 0 | 0 | 2012-07-25T07:35:00.000 | 2 | 0 | false | 11,644,808 | 0 | 0 | 0 | 2 | I have a python script that runs continuously in background and print some logs on standard output.
If I log with the same user on the same machine via ssh however I cannot see the output since (I guess) I opened a different shell.
Is there any way to specify that the standard output of this process must be seen by all... |
Add logging to tests results in jenkins | 11,650,753 | 1 | 2 | 3,561 | 0 | python,jenkins,jython,nose | There is no way to achieve this from your tests. The report generator simply won't display the output unless there are errors.
You will have to get the sources for Jenkins itself (the JUnit runner is built into it) and patch the reporter or write your own plugin. | 0 | 1 | 0 | 0 | 2012-07-25T09:35:00.000 | 2 | 0.099668 | false | 11,646,830 | 0 | 0 | 1 | 2 | I am using nose in jenkins to test a project. If a test fails, I get a short report of the output to the console. I would like to have this output regardless of the test result. So even if the test passes I want to be able to see the tests output to stderr/stdout.
At the moment I can turn off logging by calling nose wi... |
Add logging to tests results in jenkins | 11,742,115 | 2 | 2 | 3,561 | 0 | python,jenkins,jython,nose | With the latest Jenkins there is an option to save the output (Retain long standard output/error) right under the post build step belonging to JUnit. Additionally I run nose with --nocapture. This gives me a console output view on every test (an option on the left menu when I have a test opened) | 0 | 1 | 0 | 0 | 2012-07-25T09:35:00.000 | 2 | 1.2 | true | 11,646,830 | 0 | 0 | 1 | 2 | I am using nose in jenkins to test a project. If a test fails, I get a short report of the output to the console. I would like to have this output regardless of the test result. So even if the test passes I want to be able to see the tests output to stderr/stdout.
At the moment I can turn off logging by calling nose wi... |
How do I debug a Python extension written in C? | 11,648,687 | 1 | 1 | 262 | 0 | python,debugging | You can compile a debug-enabled version python in your home folder without having root access and develop the C extension against that version. | 0 | 1 | 0 | 1 | 2012-07-25T10:33:00.000 | 1 | 0.197375 | false | 11,647,810 | 0 | 0 | 0 | 1 | How do I debug a Python extension written in C? I found some links that said we need to get the Python debug built, but how do we do that if we don't have root access? I have Python 2.7 installed. |
Why do up and down arrow commands not work in the Python command line interpreter? | 11,656,437 | 7 | 10 | 6,773 | 0 | python,linux,cpython | By default, the keymappings are:
older: alt-p
more recent: alt-n
You can change it in Options -> Configure IDLE -> Keys -> "history-previous" and "history-next" respectively. | 0 | 1 | 0 | 0 | 2012-07-25T18:32:00.000 | 2 | 1 | false | 11,656,306 | 1 | 0 | 0 | 1 | I am using a VT100 terminal emulator on Linux. In bash, up and down arrows scroll through the last commands executed; they work as expected.
Previous (up arrow) and next (down arrow) commands are not interpreted in the Python command line interpreter. What kind of key mappings do I need to make this work?
Thank you. |
Aquamacs (on Mac lion): whatever I write i being interpreted as "Enter" | 18,509,905 | 1 | 0 | 323 | 0 | python,osx-lion,aquamacs | I also met with this problem recently.
You need to add minor mode Fill. Press on the Python in the mode line in mouse-3 way and choose Auto Fill. | 0 | 1 | 0 | 0 | 2012-07-25T23:27:00.000 | 1 | 0.197375 | false | 11,660,203 | 0 | 0 | 0 | 1 | I am editing a python script that I wrote a while ago, using aquamacs on Mac lion.
Whichever letter or number I type is being interpreted as "enter" (that is, I hit "g" for example, my text is dissrupted and a newline appears, but "g" does not appear). Restarting aquamacs, the terminal out of which I run it, or the who... |
How to start Python IDLE from python.exe window if possible, and if not, what is python.exe even used for? | 11,661,081 | 0 | 0 | 2,121 | 0 | python,python-idle | python.exe is Python, the python interpreter specifically. | 0 | 1 | 0 | 0 | 2012-07-26T01:22:00.000 | 3 | 0 | false | 11,661,053 | 1 | 0 | 0 | 1 | I am running Windows 7 currently, and I remember when using Linux at the school computers I was able to type "gedit &" into the terminal for example to open up the gedit text editor. I was wondering whether there is a similar process to open IDLE, and for that matter a Python program/script by typing it into the "termi... |
Is there any way to excute a command as a specific user in Python? | 11,662,267 | 2 | 2 | 814 | 0 | python,linux,shell,operating-system,command | All of the things you've mentioned (which have been succeeded by the subprocess module by the way) are ways of spawning processes. You sound like you're looking for setuid. You can either call a function that will do that (e.g. os.setuid), or, as often is the case depending on what your script does, you can just run th... | 0 | 1 | 0 | 0 | 2012-07-26T04:10:00.000 | 3 | 1.2 | true | 11,662,219 | 0 | 0 | 0 | 1 | As far as I kown, there are about 3 ways to excute a system command in Python:
os.system(command) -> exit_status
os.popen(command [, mode='r' [, bufsize]]) -> pipe
commands.getoutput(command)-> string
Now I need to control the excutor of a system command, beside the way like:
os.system('su xxx;' + command)
is there ... |
How to make Python script portable to machines with interpreters in different locations? | 11,674,391 | 2 | 1 | 155 | 0 | python | env is a program that handles these sort of things. You should pretty much always use something like #! /usr/bin/env python3 as your shebang line rather than specifying an absolute path. | 0 | 1 | 0 | 1 | 2012-07-26T17:02:00.000 | 2 | 0.197375 | false | 11,674,359 | 1 | 0 | 0 | 1 | I'm sure this is well documented somewhere, but I can't find it! I want to make my scripts portable to machines that may not have their Python interpreters in the same location. For that reason, I thought that I could just code the first line as #!python3 rather than with the absolute path to the interpreter, like #!/u... |
AppEngine datastore reserve ID range | 11,681,451 | 1 | 0 | 178 | 0 | python,google-app-engine,google-cloud-datastore | I found the answer: db.allocate_id_range(...) | 0 | 1 | 0 | 0 | 2012-07-27T04:15:00.000 | 1 | 1.2 | true | 11,681,354 | 0 | 0 | 1 | 1 | Is it possible to tell AppEngine Datastore to reserve a range of IDs, which should never be allocated to models? |
Python, UTF-8 filesystem, iso-8859-1 files | 11,835,980 | 0 | 0 | 1,707 | 0 | python,unicode,utf-8,filesystems,iso-8859-1 | Use character encoding detection, chardet modules for python work well for determining actual encoding with some confidence. "as appropriate" -- You either know the encoding or you have to guess at it. If with chardet you guess wrong, at least you tried. | 0 | 1 | 0 | 0 | 2012-07-27T13:53:00.000 | 2 | 0 | false | 11,689,223 | 1 | 0 | 0 | 1 | I have an application written in Python 2.7 that reads user's file from the hard-drive using os.walk.
The application requires a UTF-8 system locale (we check the env variables before it starts) because we handle files with Unicode characters (audio files with the artist name in it for example), and want to make sure w... |
Error when installing pyodbc on opensuse | 11,691,895 | 2 | 1 | 4,644 | 1 | python,pyodbc,opensuse | I don't see a way around having the Python header files (which are part of python-devel package). They are required to compile the package.
Maybe there was a pre-compiled egg for the 64bit version somewhere, and this is how it got installed.
Why are you reluctant to install python-devel? | 0 | 1 | 0 | 0 | 2012-07-27T15:32:00.000 | 2 | 1.2 | true | 11,691,039 | 0 | 0 | 0 | 1 | when I try to install the pyodbc by using "python setup.py build install", it shows up with some errors like the following:
gcc -pthread -fno-strict-aliasing -DNDEBUG -march=i586 -mtune=i686 -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fwrapv -fPIC ... |
Creating a Scheduled task in Tkinter on Unix | 11,691,425 | 1 | 2 | 355 | 0 | python,unix,cron,tkinter,crontab | In most modern Linux distros like Debian or Ubuntu, you can add an executable file (like a shell script or a symlink to one) into /etc/cron.weekly and it will be automatically run once a week for you. This is using the anacron command, which is fairly common these days. | 0 | 1 | 0 | 0 | 2012-07-27T15:51:00.000 | 1 | 0.197375 | false | 11,691,351 | 0 | 0 | 0 | 1 | Through an application I have made with Tkinter, I'm trying to add a command to run a script every week. When the program is closed the command should be in forever place.
I've sifted through the documentation on cron, but there doesn't seem to be a way to edit the crontab without using the shell. Also I've looked thr... |
How to continue the python script execution from the point it left before reboot | 11,700,297 | 3 | 0 | 1,400 | 0 | python,reboot | It's not about python but rather about your whole system config. In given conditions I suggest you to split your script on 2 parts. First part is doing 1..3 and storing some extra info you're required onto persistent storage other than the fs you're experimenting on. The second part is invoked on each OS os start, read... | 0 | 1 | 0 | 1 | 2012-07-28T10:24:00.000 | 1 | 0.53705 | false | 11,700,172 | 0 | 0 | 0 | 1 | I want to write a test script in python which should reboot the system in between the test execution on local machine... (No remote automation server is monitoring the script). How the script execution can be made continuous even after reboot? The script covers following scenario...
Create a Volume on some disk
Create... |
How to run a python script inside the cgi-bin of apache server? | 14,268,807 | 1 | 2 | 2,241 | 0 | python,apache | BlaXpirit's answer should solve your problem with a 500 server internal error.
It is important to note the "\n" at the end of the first print statement. You can also write it as
print("Content-Type: text/html; charset=utf-8")
print()
I was surprised to learn that writing out these headers is necessary even if your Py... | 0 | 1 | 0 | 1 | 2012-07-29T16:51:00.000 | 2 | 0.099668 | false | 11,711,060 | 0 | 0 | 0 | 1 | I put a simple python script inside the cgi-bin in apache2 and tried to execute it using the browser as follows,
"http://www.example.com/cgi-bin/test.py"
But it gives a 500 Internal sever error.
Following is the error.log in apache2.
[Sun Jul 29 22:07:51 2012] [error] (8)Exec format error: exec of '/usr/lib/cgi-bin/tes... |
Problems starting created virtualenv instance | 11,713,237 | 11 | 2 | 9,585 | 0 | python,virtualenv | You don't run activate as a script; you need to source it in your shell, since it affects the shell itself.
It probably also doesn't make any sense to run it under sudo. | 0 | 1 | 0 | 0 | 2012-07-29T21:40:00.000 | 2 | 1.2 | true | 11,713,187 | 1 | 0 | 0 | 1 | I'm trying to use virtualenv on my development machine. I successfully created my new environment issuing virtualenv venv in /home/user/. When I try to activate it (from user location) with sudo venv/bin/activate I get venv/bin/activate: command not found. |
Python: Securing untrusted scripts/subprocess with chroot and chjail? | 11,725,863 | 3 | 12 | 7,078 | 0 | python,security,subprocess,chroot,jail | After creating your jail you would call os.chroot from your Python source to go into it. But even then, any shared libraries or module files already opened by the interpreter would still be open, and I have no idea what the consequences of closing those files via os.close would be; I've never tried it.
Even if this wo... | 0 | 1 | 0 | 0 | 2012-07-30T15:09:00.000 | 2 | 1.2 | true | 11,724,257 | 0 | 0 | 0 | 1 | I'm writing a web server based on Python which should be able to execute "plugins" so that functionality can be easily extended.
For this I considered the approach to have a number of folders (one for each plugin) and a number of shell/python scripts in there named after predefined names for different events that can o... |
Dpkg Python module? | 11,727,678 | 0 | 9 | 6,866 | 0 | python,linux,apt,deb,dpkg | I have little familiarity with python modules for debs, but I wanted to point out that calling subprocesses isn't the bad thing on *ix, that it is on Windows. Windows almost seems intended to break calling things as a subprocess and parsing output, but *ix usually makes it quite viable. | 0 | 1 | 0 | 0 | 2012-07-30T18:02:00.000 | 4 | 0 | false | 11,727,011 | 0 | 0 | 0 | 2 | I'm trying to do some package manipulation (a la dpkg) and while I can just popen or subprocess.call I'd rather do things the python way if possible.
Unfortunately I've been unable to find a python module to do the trick.
I've seen reference to python-deb but it appears to be defunct. python-apt might seem like a poten... |
Dpkg Python module? | 11,728,384 | 0 | 9 | 6,866 | 0 | python,linux,apt,deb,dpkg | Apparently Gdebi is python based. If gdebi installed you have access to it's functionality via the GDebi module.
I can't seem to find any documentation, so I'm not sure that it's meant to be a public API, but it might do the trick. | 0 | 1 | 0 | 0 | 2012-07-30T18:02:00.000 | 4 | 0 | false | 11,727,011 | 0 | 0 | 0 | 2 | I'm trying to do some package manipulation (a la dpkg) and while I can just popen or subprocess.call I'd rather do things the python way if possible.
Unfortunately I've been unable to find a python module to do the trick.
I've seen reference to python-deb but it appears to be defunct. python-apt might seem like a poten... |
Disable 'pause' in windows bat script | 11,729,668 | 18 | 9 | 6,479 | 0 | python,windows,batch-file,cmd | Try to execute cmd.exe /c YourCmdFile < nul
YourCmdFile - full path to your batch script | 0 | 1 | 0 | 0 | 2012-07-30T21:04:00.000 | 4 | 1.2 | true | 11,729,562 | 1 | 0 | 0 | 1 | In windows, I am running a bat script that currently ends with a 'pause' and prompts for the user to 'Press any key to continue...'
I am unable to edit the file in this scenario and I need the script to terminate instead of hang waiting for input that will never come. Is there a way I can run this that will disable or ... |
I need to run a python script from php | 11,733,222 | 0 | 2 | 634 | 0 | php,python,qiime | instead of system() try surrounding the code in `ticks`...
It has a similar functionality but behaves a little differently in the way it returns the output.. | 0 | 1 | 0 | 1 | 2012-07-31T04:33:00.000 | 3 | 0 | false | 11,733,149 | 0 | 0 | 0 | 1 | I have to design a interface using PHP for a software written in python. Currently this software is used from command line by passing input, mostly the input is a text file. There are series of steps and for every step a python script is called. Every step takes a text file as input and an generates an output text file... |
How to clear output in Vte.Terminal? | 11,804,847 | 0 | 1 | 303 | 0 | python,gtk,pygtk,vte | I have been having some problems of my own with Vte so I don't know if I'm the right person to answer.
Have you tried replacing the old terminal with another in the container? It's not clearing, but there will be an empty terminal. | 0 | 1 | 0 | 0 | 2012-07-31T05:02:00.000 | 4 | 0 | false | 11,733,391 | 1 | 0 | 0 | 2 | How to clear all output in Vte.Terminal ? |
How to clear output in Vte.Terminal? | 11,742,327 | 0 | 1 | 303 | 0 | python,gtk,pygtk,vte | It would only clear the text visible in the terminal, but, you can run the cls command or tinker with the feed() method and empty spaces. | 0 | 1 | 0 | 0 | 2012-07-31T05:02:00.000 | 4 | 0 | false | 11,733,391 | 1 | 0 | 0 | 2 | How to clear all output in Vte.Terminal ? |
application run slowly under uwsgi threaded mode | 11,733,510 | 0 | 1 | 947 | 0 | python,memcached,uwsgi | You are probably experiencing the python GIL overhead. Try adding a second process to see if results are better. | 0 | 1 | 0 | 0 | 2012-07-31T05:06:00.000 | 1 | 0 | false | 11,733,437 | 0 | 0 | 1 | 1 | we use uwsgi + nginx to build the web site. recently, we want to improve the qps of our site, so we decide to switch uwsgi mode from prefork to threaded. but we found something very bad.
when using prefork mode with workers setting 5, we get the request time is 10-20ms. but in threaded mode(one worker 5 threads), the v... |
Activated VENV still use system pip and system python? What's wrong? | 11,735,136 | 0 | 6 | 2,687 | 0 | python,virtualenv,pip | What shell are you using? What specific command did you use to activate the virtualenv?
In my case (also using squeeze) I am using bash and it if I run "source bin/activate" then everything in my path (pip, python, etc) is correct. | 0 | 1 | 0 | 0 | 2012-07-31T07:19:00.000 | 2 | 0 | false | 11,735,073 | 1 | 0 | 0 | 1 | When I activate a venv, which pip returns /usr/local/bin/pip instead of path/to/my/apps/venv/bin/pop. Why is that?
I am inclined to just rm- rf the pip in /usr/local/bin/pip and install again, but since this is a production server I prefer not to guess too much :-)
My concern is that I have (in usr/local/bin):
easy_in... |
How to open a new console and run a python script | 11,735,588 | 0 | 0 | 3,127 | 0 | python,bash,sublimetext2 | If you're using python 3.2 you can use the python debugger. At the beginning of your project, import pdb. Then at the point that you want to enter interactive mode, type pdb.set_trace(). (You have to put the trace one line above the last line, otherwise the program will finish and restart.) I don't know how to make it ... | 0 | 1 | 0 | 0 | 2012-07-31T07:28:00.000 | 5 | 0 | false | 11,735,203 | 1 | 0 | 0 | 1 | Here is my problem: When running a python script from command line (bash), I'd like to open a new console window, run my python script and end up in the interactive python shell. Is there an easy way to do this?
Background: Right now, I am exploring sublime text 2 by developing a simple python script together with nump... |
Python: OAuth Library for Linux and Windows | 11,759,545 | 2 | 2 | 736 | 0 | python,oauth | All Python libraries that don't rely on native code or platform-specific APIs are portable. I don't see any of that in python-oauth or python-oauth2.
So your current library should work fine on Linux. | 0 | 1 | 1 | 0 | 2012-08-01T12:33:00.000 | 2 | 1.2 | true | 11,759,307 | 0 | 0 | 0 | 1 | Is there a python library for oAuth which can be run on Window and Linux?
On window I am using python-oauth but I could not find an installation for Linux |
Maintaining a (singleton) process with mod_wsgi? | 11,768,941 | 0 | 1 | 396 | 0 | python,apache,mod-wsgi,web.py | Easy. Don't restart Apache, don't set maximum-requests and don't change the code in the WSGI script file.
Are you saying that you are seeing restarts even when you leave Apache completely untouched?
And yes it sounds like you should be re-architecting your system. A web process that takes that long to startup is crazy. | 0 | 1 | 0 | 0 | 2012-08-01T14:46:00.000 | 1 | 1.2 | true | 11,761,785 | 0 | 0 | 1 | 1 | I have a python web.py app with long (minutes) start-up time that I'd like to host with in Apache with mod_wsgi.
The long-term answer may be "rewrite the app." But in the short term I'd like to configure mod_wsgi to:
Use a single process to serve the app (I can do this with WSGIDaemonProcess processes=1),
and
Keep u... |
How to test if packet is sent correct? | 11,763,064 | 0 | 0 | 1,276 | 0 | c++,python,testing,networking | The only way to check if a packet has been sent correctly is by verifying it's integrity on the receiving end. | 0 | 1 | 1 | 1 | 2012-08-01T15:40:00.000 | 3 | 0 | false | 11,762,812 | 0 | 0 | 0 | 2 | In my app i sent packet by raw socket to another computer than get packet back and write the return packet to another computer by raw socket.
My app is c++ application run on Ubuntu work with nfqueue.
I want to test sent packets for both computer1 and computer2 in order to check if they are as expected.
I need to writ... |
How to test if packet is sent correct? | 11,809,920 | 0 | 0 | 1,276 | 0 | c++,python,testing,networking | I operate tcpdump on the reciver coputer and save all packet to file.
I analysis the tcpdump with python and check that packet send as expected in the test. | 0 | 1 | 1 | 1 | 2012-08-01T15:40:00.000 | 3 | 1.2 | true | 11,762,812 | 0 | 0 | 0 | 2 | In my app i sent packet by raw socket to another computer than get packet back and write the return packet to another computer by raw socket.
My app is c++ application run on Ubuntu work with nfqueue.
I want to test sent packets for both computer1 and computer2 in order to check if they are as expected.
I need to writ... |
Import data into Google App Engine in a way that is "easy" for the user of the application | 11,780,827 | 1 | 1 | 181 | 0 | python,google-app-engine,google-cloud-datastore,data-import | Have the user upload the file, then start a task that runs the import. Email results/errors to the user at the end. The other way I have done, is get the user to create the spreadsheet in google docs and have them supply the sheet key or link if it's published and then start a task that processes the spreadsheet direc... | 0 | 1 | 0 | 0 | 2012-08-02T14:00:00.000 | 2 | 0.099668 | false | 11,779,033 | 0 | 0 | 1 | 1 | Building an application using Python in GAE that handles a lot of user data such as contacts, appointments, etc...
Would like to allow users to import their old data from other applications. For example an appointment might look like:
Start time Duration Service Customer Id
2012-08-02 09:50AM, 01:00:00, ... |
django-admin.py: command not found | 24,193,778 | 1 | 3 | 6,301 | 0 | python,django,django-admin | i have the same Problem. the django-admin.py for me was in this Path ~/.local/bin.
this because i run pip instal --user django | 0 | 1 | 0 | 0 | 2012-08-03T07:41:00.000 | 3 | 0.066568 | false | 11,791,368 | 0 | 0 | 1 | 1 | I have django-admin.py in usr/local/bin and I have tried all the help given on the web to make a symbolic link but it still says django-admin.py: command not found.
I am trying to start of my first project in django :- django-admin.py startproject mysite.
No matter what I do I just keep on getting django-admin.py: com... |
Print python script output correctly in PHP | 11,792,313 | 0 | 3 | 10,514 | 0 | php,python | An alternative would be wrapping the string between <pre>...</pre> tags. | 0 | 1 | 0 | 1 | 2012-08-03T08:32:00.000 | 4 | 0 | false | 11,792,129 | 0 | 0 | 0 | 1 | i have a php file calls a script and prints the output like this
$output=shell_exec('/usr/bin/python hello.py');
echo $output;
it prints;
b'total 16\ndrwx---r-x 2 oae users 4096 Jul 31 14:21 .\ndrwxr-x--x+ 9 oae root 4096 Jul 26 13:59 ..\n-rwx---r-x 1 oae users 90 Aug 3 11:22 hello.py\n-rwx---r-x 1 oa... |
Using WebSphere MQ with Twisted | 11,794,331 | 1 | 0 | 245 | 0 | python,ibm-mq,twisted,pymqi | If you're going to use this functionality a lot, then having a native Twisted implementation is probably worth the effort. A wrapper based on deferToThread will be less work, but it will also be harder to test and debug, perform less well, and have problems on certain platforms where Python threads don't work extremel... | 0 | 1 | 0 | 0 | 2012-08-03T08:58:00.000 | 1 | 1.2 | true | 11,792,531 | 0 | 0 | 0 | 1 | I'm trying to work out how to approach building a "machine" to send and receive messages to WebSphere MQ, via Twisted. I want it to be as generic as possible, so I can reuse it for many different situations that interface with MQ.
I've used Twisted before, but many years ago now and I'm trying to resurrect the knowled... |
I'm trying to use python in powershell | 11,814,706 | 20 | 65 | 202,736 | 0 | python,powershell,python-2.7 | $env:path="$env:Path;C:\Python27" will only set it for the current session. Next time you open Powershell, you will have to do the same thing again.
The [Environment]::SetEnvironmentVariable() is the right way, and it would have set your PATH environment variable permanently. You just have to start Powershell again to ... | 0 | 1 | 0 | 0 | 2012-08-05T02:05:00.000 | 13 | 1 | false | 11,813,435 | 1 | 0 | 0 | 5 | I'm trying to follow Zed Shaw's guide for Learning Python the Hard Way. I need to use python in Powershell. I have Python 2.7.3 installed in C:\Python27. Whenever I type python into Powershell, I get an error that says the term 'python' is not recognized as the name of a cmdlet, function, script file, or operable pr... |
I'm trying to use python in powershell | 33,180,819 | 11 | 65 | 202,736 | 0 | python,powershell,python-2.7 | The Directory is not set correctly so Please follow these steps.
"MyComputer">Right Click>Properties>"System Properties">"Advanced" tab
"Environment Variables">"Path">"Edit"
In the "Variable value" box, Make sure you see following:
;c:\python27\;c:\python27\scripts
Click "OK", Test this change by restarting your windo... | 0 | 1 | 0 | 0 | 2012-08-05T02:05:00.000 | 13 | 1 | false | 11,813,435 | 1 | 0 | 0 | 5 | I'm trying to follow Zed Shaw's guide for Learning Python the Hard Way. I need to use python in Powershell. I have Python 2.7.3 installed in C:\Python27. Whenever I type python into Powershell, I get an error that says the term 'python' is not recognized as the name of a cmdlet, function, script file, or operable pr... |
I'm trying to use python in powershell | 31,302,445 | 7 | 65 | 202,736 | 0 | python,powershell,python-2.7 | This works for me permanently:
[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27","User") | 0 | 1 | 0 | 0 | 2012-08-05T02:05:00.000 | 13 | 1 | false | 11,813,435 | 1 | 0 | 0 | 5 | I'm trying to follow Zed Shaw's guide for Learning Python the Hard Way. I need to use python in Powershell. I have Python 2.7.3 installed in C:\Python27. Whenever I type python into Powershell, I get an error that says the term 'python' is not recognized as the name of a cmdlet, function, script file, or operable pr... |
I'm trying to use python in powershell | 37,464,667 | 4 | 65 | 202,736 | 0 | python,powershell,python-2.7 | Sometimes you install Python on Windows and it doesn't configure the path correctly.
Make sure you enter [Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27", "User")
in PowerShell to configure it correctly.
You also have to either restart PowerShell or your whole computer to get it to really be... | 0 | 1 | 0 | 0 | 2012-08-05T02:05:00.000 | 13 | 0.061461 | false | 11,813,435 | 1 | 0 | 0 | 5 | I'm trying to follow Zed Shaw's guide for Learning Python the Hard Way. I need to use python in Powershell. I have Python 2.7.3 installed in C:\Python27. Whenever I type python into Powershell, I get an error that says the term 'python' is not recognized as the name of a cmdlet, function, script file, or operable pr... |
I'm trying to use python in powershell | 18,043,232 | 0 | 65 | 202,736 | 0 | python,powershell,python-2.7 | Just eliminate the word "User". It will work. | 0 | 1 | 0 | 0 | 2012-08-05T02:05:00.000 | 13 | 0 | false | 11,813,435 | 1 | 0 | 0 | 5 | I'm trying to follow Zed Shaw's guide for Learning Python the Hard Way. I need to use python in Powershell. I have Python 2.7.3 installed in C:\Python27. Whenever I type python into Powershell, I get an error that says the term 'python' is not recognized as the name of a cmdlet, function, script file, or operable pr... |
How to run a python script with Python Tools for Visual Studio in a virtualenv? | 11,826,101 | 4 | 6 | 30,422 | 0 | python,visual-studio-2010,ptvs | I found that if :
main.py is set as Startup File,
in the Properties of the project -> Debug tab -> Interpreter Path field, I put the path C:...\env\Scripts\python.exe (i.e. the python executable of the virtualenv)
It works ! | 0 | 1 | 0 | 0 | 2012-08-06T08:06:00.000 | 4 | 1.2 | true | 11,824,589 | 1 | 0 | 0 | 1 | I don't know how to run the activate.bat in a Python Tools for Visual Studio Project. I have a directory environment in my project with my virtualenv. But, I don't know how I can run ./env/Scripts/activate.bat before the project run my main python script. |
Selectively indexing subdomains | 11,829,421 | 1 | 0 | 134 | 0 | python,seo,indexing,robots.txt,googlebot | No. The search engine should not care what script generates the pages. Just so long as the pages generated by the webapps are indexed you should be fine.
Second question:
You should create a separate robots.txt per subdomain. That is when robots.txt is fetched from a particular subdomain, return a robots.txt file that ... | 0 | 1 | 0 | 1 | 2012-08-06T13:34:00.000 | 2 | 1.2 | true | 11,829,360 | 0 | 0 | 1 | 1 | I am working on Web application, which allows users to create their own webapp in turn. For each new webapp created by my application I Assign a new Subdomain.
e.g. subdomain1.xyzdomain.com, subdomain2.xyzdomain.com etc.
All these Webapps are stored in Database and are served by a python script (say
default_script.py)... |
rename a build in buildbot | 12,306,901 | 2 | 22 | 812 | 0 | python,buildbot | If you don't care about the name of the directory, just the name of the builder, you can set the builddir attribute of the builder to be whatever it currently is, then name you builder however you want.
The data stored in the builder directory is in pickles. Looking at the code, I think the only data could cause issues... | 0 | 1 | 0 | 0 | 2012-08-06T23:24:00.000 | 1 | 1.2 | true | 11,837,330 | 0 | 0 | 0 | 1 | Is there a way to rename a build in buildbot without losing all of the logs?
For instance I have several windows slaves which all might build: "Windows 2008+ DEBUG" but I want to rename this build to: "Windows 2008R2+ DEBUG".
How do I set compare_attr (if that's even what I need to do) so that all of the logs/etc... ar... |
How to run Python script with one icon click? | 11,848,690 | 4 | 6 | 15,947 | 0 | python,ubuntu,compilation,nautilus | You should make the .py files executable and click on them. The .pyc files cannot be run directly. | 0 | 1 | 0 | 0 | 2012-08-07T14:55:00.000 | 3 | 0.26052 | false | 11,848,650 | 1 | 0 | 0 | 2 | Sorry, for the vague question, don't know actually how to ask this nor the rightful terminologies for it.
How to run a python script/bytecode/.pyc (any compiled python code) without going through the terminal. Basically on Nautilus: "on double click of the python script, it'll run" or "on select then [Enter], it'll r... |
How to run Python script with one icon click? | 12,015,527 | 1 | 6 | 15,947 | 0 | python,ubuntu,compilation,nautilus | Adding " #!/usr/bin/env python " at the top of the .py file works! Hmm, although don't appreciate the pop-up, but nevermind. :P
From PHPUG:
You do not invoke the pyc file. It's the .py file that's invoked. Python is an interpreted language.
A simpler way to make a python exectuable (explained):
1) Add #!/usr/bin/env ... | 0 | 1 | 0 | 0 | 2012-08-07T14:55:00.000 | 3 | 1.2 | true | 11,848,650 | 1 | 0 | 0 | 2 | Sorry, for the vague question, don't know actually how to ask this nor the rightful terminologies for it.
How to run a python script/bytecode/.pyc (any compiled python code) without going through the terminal. Basically on Nautilus: "on double click of the python script, it'll run" or "on select then [Enter], it'll r... |
Can I make a script to open terminal and run .py? | 11,854,667 | 0 | 3 | 4,323 | 0 | python,macos,terminal | Automator would be your best bet actually, creating Macintosh .app bundles by hand can be annoying.
It's been a long time since I've used automator, but here goes, use the Run Shell Script command from Terminal, and make the script be python ~/Desktop/script.py or maybe use the full path like python /Users/<username>/D... | 0 | 1 | 0 | 0 | 2012-08-07T20:42:00.000 | 3 | 0 | false | 11,853,818 | 0 | 0 | 0 | 3 | I have a simple python script I can run through terminal. Is there a way to put a shortcut on my mac desktop to open terminal and run like "cd ~/Desktop/script.py"? I have tried automator but i couldn't get it to work |
Can I make a script to open terminal and run .py? | 11,853,877 | -1 | 3 | 4,323 | 0 | python,macos,terminal | you have to create a samplename.sh file and put the below line and run it ./samplename.sh
~/Desktop/script.py
create symbolic link to that .sh file and place it on desktop. | 0 | 1 | 0 | 0 | 2012-08-07T20:42:00.000 | 3 | -0.066568 | false | 11,853,818 | 0 | 0 | 0 | 3 | I have a simple python script I can run through terminal. Is there a way to put a shortcut on my mac desktop to open terminal and run like "cd ~/Desktop/script.py"? I have tried automator but i couldn't get it to work |
Can I make a script to open terminal and run .py? | 11,854,938 | 6 | 3 | 4,323 | 0 | python,macos,terminal | Create a file called anyname.command with python ~/Desktop/script.py in it. Then make it executable by running chmod 555 ~/Desktop/anyname.command in terminal. Then when you double-click on anyname.command it should run the python script. | 0 | 1 | 0 | 0 | 2012-08-07T20:42:00.000 | 3 | 1.2 | true | 11,853,818 | 0 | 0 | 0 | 3 | I have a simple python script I can run through terminal. Is there a way to put a shortcut on my mac desktop to open terminal and run like "cd ~/Desktop/script.py"? I have tried automator but i couldn't get it to work |
How to change ancestor of an NDB record? | 11,855,209 | 9 | 5 | 1,422 | 1 | python,google-app-engine,google-cloud-datastore | The only way to change the ancestor of an entity is to delete the old one and create a new one with a new key. This must be done for all child (and grand child, etc) entities in the ancestor path. If this isn't possible, then your listed solution works.
This is required because the ancestor path of an entity is part of... | 0 | 1 | 0 | 0 | 2012-08-07T21:04:00.000 | 1 | 1.2 | true | 11,854,137 | 0 | 0 | 1 | 1 | In the High-Replication Datastore (I'm using NDB), the consistency is eventual. In order to get a guaranteed complete set, ancestor queries can be used. Ancestor queries also provide a great way to get all the "children" of a particular ancestor with kindless queries. In short, being able to leverage the ancestor model... |
Swapy could not be used to access swing properties of swing based java application.How to access swing properties of a java application | 12,048,644 | 5 | 0 | 1,126 | 0 | python,swing,ui-automation,pywinauto | Pywinauto uses standard windows API calls. Unfortunately many UI libraries (like Swing/QT/GTK) do not respond in a typical way to the API calls used - so unfortunately pywinauto usually cannot get the control information. (I am the Author of pywinauto).
I can't give you a way to access the properties of the Swing contr... | 0 | 1 | 0 | 0 | 2012-08-08T08:07:00.000 | 1 | 1.2 | true | 11,860,280 | 0 | 0 | 1 | 1 | I am using swapy(desktop automation tool which uses pywinauto python package) to automate desktop UI activities, but swapy does not recognize the properties of a swing based java application, but it can recognize the properties of other applications like notepad windows media player etc..
can anybody please the reason ... |
Installing 3rd party Python modules on an Ubuntu Linux machine? | 31,068,954 | 0 | 13 | 63,583 | 0 | python,module | To install nay python package in ubuntu, first run
sudo apt-get update
Then type "sudo apt-get install python-" and press tab twice repeatedly.
press y or yes and it will display all the packages available for python. Then again type
sudo apt-get install python-package
It will install the package from the internet. | 0 | 1 | 0 | 1 | 2012-08-09T23:11:00.000 | 5 | 0 | false | 11,893,311 | 0 | 0 | 0 | 2 | I'm guessing my question is pretty basic, but after 15-20 minutes on Google and YouTube, I am still a little fuzzy. I am relatively new to both Linux and Python, so I am having some difficulty comprehending the file system tree (coming from Windows).
From what I've found digging around the directories in Ubuntu (which ... |
Installing 3rd party Python modules on an Ubuntu Linux machine? | 11,893,356 | 11 | 13 | 63,583 | 0 | python,module | You aren't supposed to manually install anything.
There are three ways to install Python libraries:
Use apt-get, aptitude or similar utilities.
Use easy_install or pip (install pip first, its not available by default)
If you download some .tar.gz file, unzip it and then type sudo python setup.py install
Manually mess... | 0 | 1 | 0 | 1 | 2012-08-09T23:11:00.000 | 5 | 1 | false | 11,893,311 | 0 | 0 | 0 | 2 | I'm guessing my question is pretty basic, but after 15-20 minutes on Google and YouTube, I am still a little fuzzy. I am relatively new to both Linux and Python, so I am having some difficulty comprehending the file system tree (coming from Windows).
From what I've found digging around the directories in Ubuntu (which ... |
How can we transfer large amounts of data over a network, using Python? | 11,895,345 | 3 | 1 | 723 | 0 | python,networking,file-transfer | I think your best bet is to use scp or rsync from within screen. That way you can detach the screen session and logout and the transfer will keep going.
man screen | 0 | 1 | 0 | 1 | 2012-08-10T04:00:00.000 | 1 | 1.2 | true | 11,895,298 | 0 | 0 | 0 | 1 | I am working on a task to back up (copy) about 100 Gb of data (including a thousand files and sub folders in a directory) to another server. Normally, for the smaller scale, I can use scp or rsync instead. However, as the other server is not on the same LAN network, it could easily take hours, even days, to complete th... |
How can I check programmatically the status of my task queue in Google Appengine? | 11,903,487 | 0 | 6 | 585 | 0 | python,google-app-engine,queue | There is a task queue link on your appengine console where you can look at the pending tasks, statistics and see what's going on. | 0 | 1 | 0 | 0 | 2012-08-10T13:41:00.000 | 2 | 0 | false | 11,902,954 | 0 | 0 | 1 | 1 | I am firing up a queue to complete some tasks in Python Appengine application. Is there a way to get the status of the queue? I would like to check whether it is still running or has incomplete tasks. |
How to deal with deployments to a single host with multiple application servers using Fabric? | 11,918,085 | 2 | 3 | 202 | 0 | python,host,fabric | It's just python so do what you need to do to keep them seperate. You can define the dir differences in a dictionary or some yaml file that's read into the script. There isn't anything made in fabric to make you do it one way nor provide any specific way to do this.
But essentially just keep in mind that it's not a DSL... | 0 | 1 | 0 | 0 | 2012-08-10T23:00:00.000 | 1 | 0.379949 | false | 11,910,295 | 0 | 0 | 1 | 1 | I have many application servers running on the same host. Every application server is installed in a different directory.
How should I tackle deployments on the servers, using Fabric? I would like to be able to perform deployments on each server separately, and on subsets of servers. Clearly the env.hosts parameter has... |
keeping libraries at correct place when multiple pythons are installed | 11,912,085 | 1 | 1 | 65 | 0 | python,opencv | When you configure your interpreter in eclipe (either the first time, or by going to the preferences menu) you need to select an interpreter (don't use the auto-configuration).
Eclipe will use that interpreter, and libraries relative to it. If you install new libraries, just go back to prefrences>pydev>interpreter, an... | 0 | 1 | 0 | 0 | 2012-08-11T05:01:00.000 | 1 | 0.197375 | false | 11,912,049 | 1 | 0 | 0 | 1 | QUESTION1:I have 3 versions of pythons installed in my mac.
1.Apple supplied one (2.7.1) (/usr/local/bin)
2.Macports installed one (2.7.3) (/opt/local/bin)
3.and one from python.org (2.7.3) (/Library/Frameworks/Python.framework/Versions/2.7/bin)
I would like to add external modules like opencv,pygame.I have no... |
Cron job on Appengine - first time on start? | 11,918,536 | 2 | 0 | 211 | 0 | python,google-app-engine,cron | There is no "launch" the app in production as such. You deploy the app for the first time and crontab is now present and crontab scheduling is started. So I assume you really mean you would like to run the cron job every time you deploy a new version of your application in addition to the cron schedule.
The cron handl... | 0 | 1 | 0 | 1 | 2012-08-11T21:37:00.000 | 1 | 0.379949 | false | 11,917,869 | 0 | 0 | 1 | 1 | I am successfully running a cron job every hour on Google Appengine. However I would like it to start when I launch the app. Now it does the first cron job 1 hour after the start.
I am using Python. |
Aptana getting path of Windows python interpreter instead of linux | 12,043,683 | 0 | 0 | 124 | 0 | aptana,ubuntu-10.04,pythonpath | I just changed the workspace and it works fine now. After doing so it asked for some paths for interpreter and I gave that and it works fine now. | 0 | 1 | 0 | 1 | 2012-08-12T03:11:00.000 | 1 | 1.2 | true | 11,919,437 | 0 | 0 | 0 | 1 | I was working on a project using windows in Aptana. I changed my OS and installed ubuntu on unpartitioned space. I again downloaded Aptana for ubuntu and run it. I specified same workspace that I was using during windows as my that project partition is still there.
The problem I am having is that I am unable to use Ap... |
How to change the path of Python in Spyder? | 53,098,634 | 0 | 25 | 92,641 | 0 | python,ide,path,spyder | Execute the following command: %cd"P:\Python" | 0 | 1 | 0 | 0 | 2012-08-12T03:59:00.000 | 4 | 0 | false | 11,919,615 | 1 | 0 | 0 | 3 | I'm using Debian. I installed Python 3.2.3. The path of Python 3 is /usr/bin/python3.
How do I change it in Spyder? |
How to change the path of Python in Spyder? | 12,355,200 | 36 | 25 | 92,641 | 0 | python,ide,path,spyder | Press CTRL+SHIFT+ALT+P to open the Preferences window. Within this window, select the Console item on the left, then the Advanced Settings tab. The path to the Python executable will be right there. | 0 | 1 | 0 | 0 | 2012-08-12T03:59:00.000 | 4 | 1.2 | true | 11,919,615 | 1 | 0 | 0 | 3 | I'm using Debian. I installed Python 3.2.3. The path of Python 3 is /usr/bin/python3.
How do I change it in Spyder? |
How to change the path of Python in Spyder? | 49,143,964 | 0 | 25 | 92,641 | 0 | python,ide,path,spyder | simple if your not able to change the working directory .Press CTRL+SHIFT+ALT+P to open the Preferences window then go to RUN then see the working directory options and finally press the option THE CURRENT WORKING DIRECTORY. | 0 | 1 | 0 | 0 | 2012-08-12T03:59:00.000 | 4 | 0 | false | 11,919,615 | 1 | 0 | 0 | 3 | I'm using Debian. I installed Python 3.2.3. The path of Python 3 is /usr/bin/python3.
How do I change it in Spyder? |
Secured communication between two web servers (Amazon EC2 with Django and Google App Engine) | 11,960,819 | 1 | 3 | 705 | 0 | python,django,google-app-engine,amazon-ec2,urllib | For server to server communication, traditional security advice would recommend some sort of IP range restriction at the web server level for the URLs in addition to whatever default security is in place. However, since you are making the call from a cloud provider to another cloud provider, your ability to permanently... | 0 | 1 | 0 | 0 | 2012-08-13T20:49:00.000 | 3 | 0.066568 | false | 11,942,094 | 0 | 0 | 1 | 2 | I have a website which uses Amazon EC2 with Django and Google App Engine for its powerful Image API and image serving infrastructure. When a user uploads an image the browser makes an AJAX request to my EC2 server for the Blobstore upload url. I'm fetching this through my Django server so I can check whether the user i... |
Secured communication between two web servers (Amazon EC2 with Django and Google App Engine) | 11,960,193 | 2 | 3 | 705 | 0 | python,django,google-app-engine,amazon-ec2,urllib | apart from the Https call ( which you should be making to transfer info to django ), you can go with AES encryption ( use Pycrypto/ any other lib). It takes a secret key to encrypt your message. | 0 | 1 | 0 | 0 | 2012-08-13T20:49:00.000 | 3 | 1.2 | true | 11,942,094 | 0 | 0 | 1 | 2 | I have a website which uses Amazon EC2 with Django and Google App Engine for its powerful Image API and image serving infrastructure. When a user uploads an image the browser makes an AJAX request to my EC2 server for the Blobstore upload url. I'm fetching this through my Django server so I can check whether the user i... |
Website sync of contacts and reminders with iCloud | 11,973,429 | 1 | 4 | 1,657 | 0 | php,python,api,sync,icloud | To the best of my knowledge, there is no way to interface with iCloud directly; it can only be done through an iOS or Mac OS app, and by calling the correct iCloud Objective-C APIs with UI/NSDocument classes. Since you are not using Cocoa, let alone Objective-C, you will most likely not be able to do this. I may be wro... | 0 | 1 | 0 | 0 | 2012-08-15T13:23:00.000 | 4 | 0.049958 | false | 11,970,079 | 0 | 0 | 1 | 2 | I'm building custom CRM web based system and have integrated synchronization of contacts and reminders with Google apps and need do the same with Apple iCloud. Is there any way how to do it? I haven't find any official API for this purpose, CRM is written in PHP, but I'm able to use python for this purpose as well. |
Website sync of contacts and reminders with iCloud | 12,255,882 | 0 | 4 | 1,657 | 0 | php,python,api,sync,icloud | I would recommend that you sync using the google contacts api. Then, you can tell iPhone people to use that instead of iCloud. | 0 | 1 | 0 | 0 | 2012-08-15T13:23:00.000 | 4 | 0 | false | 11,970,079 | 0 | 0 | 1 | 2 | I'm building custom CRM web based system and have integrated synchronization of contacts and reminders with Google apps and need do the same with Apple iCloud. Is there any way how to do it? I haven't find any official API for this purpose, CRM is written in PHP, but I'm able to use python for this purpose as well. |
How to run PyCharm using port 80 | 38,212,424 | 2 | 8 | 8,103 | 0 | python,django,pycharm | To give PyCharm permissions, one has to run as Administor (Windows) or using sudo if on OSX/Linux: sudo /Applications/PyCharm.app/Contents/MacOS/pycharm. Note that this truly runs PyCharm as a new user, so you'll have to register the app again and set up your customizations again if you have any (ie theme, server prof... | 0 | 1 | 0 | 0 | 2012-08-16T13:49:00.000 | 4 | 0.099668 | false | 11,988,636 | 0 | 0 | 0 | 2 | I can't run my PyCharm IDE using port 80.
I need to use PayPal that requires me to use port 80.
But using Mac OS X 10.8 I can't have it working because of permission issues.
I've already tried running PyCharm with SUDO command.
Does anyone know how to run Pycharm using port 80, or any other solution?
Thanks. |
How to run PyCharm using port 80 | 22,296,578 | 1 | 8 | 8,103 | 0 | python,django,pycharm | For the ones who are looking for the answer of this question, please check your Pycharm Run/Debug Configurations. Run->Edit Configurations ->Port | 0 | 1 | 0 | 0 | 2012-08-16T13:49:00.000 | 4 | 0.049958 | false | 11,988,636 | 0 | 0 | 0 | 2 | I can't run my PyCharm IDE using port 80.
I need to use PayPal that requires me to use port 80.
But using Mac OS X 10.8 I can't have it working because of permission issues.
I've already tried running PyCharm with SUDO command.
Does anyone know how to run Pycharm using port 80, or any other solution?
Thanks. |
Calling pdb.set_trace from script invoked from os.system | 12,004,423 | 0 | 0 | 132 | 0 | python,pdb | If you are using output redirection, the pdb prompt will be redirected as well. | 0 | 1 | 0 | 0 | 2012-08-17T05:50:00.000 | 1 | 1.2 | true | 12,000,436 | 0 | 0 | 0 | 1 | I want to debug a python script which is invoked via os.system() from another python script. I tried calling pdb.set_trace from the invoked code but it doesn't work. I can't see the Python pdb prompt.
Its sort of automation framework. My final python script where i want to put set_trace is like:
python script1.py --in... |
Web server to run python code | 12,027,902 | 1 | 0 | 223 | 0 | python,webserver,hosting | Go for Amazon Ec2 instance, Ubantu server. If your process is not much memory consuming , you can go with Micro instance(617 Mb ram, 8 Gb HD) which is free for first year. Or you could go with small instance (1.7 GB ram and 8Gb HD), which might cost you little more.
For setting up the python code to run 24/7 , you can... | 0 | 1 | 1 | 0 | 2012-08-19T15:49:00.000 | 2 | 1.2 | true | 12,027,815 | 0 | 0 | 0 | 1 | I'm sorry if my question is too elementary. I have some python code, which makes the machine act as a transparent proxy server using "twisted" library. Basically I want my own transparent proxy OUTSIDE my internal network and since I want to be able to monitor traffic, I need to have my own server. So I need a machine ... |
Making a job fail in jenkins | 70,767,921 | 0 | 8 | 15,709 | 0 | python,jenkins | I came across this as a noob and found the accepted answer is missing something if you're running python scripts through a Windows batch shell in Jenkins.
In this case, Jenkins will only fail if the very last command in the shell fails. So your python command may fail but if there is another line after it which changes... | 0 | 1 | 0 | 1 | 2012-08-20T11:11:00.000 | 4 | 0 | false | 12,036,620 | 0 | 0 | 0 | 1 | This question might sound weird, but how do I make a job fail?
I have a python script that compiles few files using scons, and which is running as a jenkins job. The script tests if the compiler can build x64 or x86 binaries, I want the job to fail if it fails to do one of these.
For instance: if I'm running my scrip... |
Data analysis using MapReduce in MongoDb vs a Distributed Queue using Celery & RabbitMq | 12,079,563 | 0 | 1 | 944 | 0 | python,mongodb,mapreduce,celery,distributed-computing | It's impossible to say without benchmarking for certain, but my intuition leans toward doing more calculations in Python rather than mapreduce. My main concern is that mapreduce is single-threaded: One MongoDB process can only run one Javascript function at a time. It can, however, serve thousands of queries simultaneo... | 0 | 1 | 0 | 0 | 2012-08-20T21:13:00.000 | 1 | 0 | false | 12,045,278 | 0 | 1 | 0 | 1 | I am currently working on a project which involves performing a lot of statistical calculations on many relatively small datasets. Some of these calculations are as simple as computing a moving average, while others involve slightly more work, like Spearman's Rho or Kendell's Tau calculations.
The datasets are essenti... |
Using Multiple Installations of Celery with a Redis Backend | 12,089,960 | 2 | 13 | 4,720 | 0 | python,redis,celery | I've used a redis backend for celery while also using the same redis db with prefixed cache data. I was doing this during development, I only used redis for the result backend not to queue tasks, and the production deployment ended up being all AMQP (redis only for caching). I didn't have any problems and don't see w... | 0 | 1 | 0 | 0 | 2012-08-21T09:39:00.000 | 2 | 1.2 | true | 12,052,094 | 0 | 0 | 1 | 1 | Is it possible to use the same redis database for multiple projects using celery? Like using the same database for multiple projects as a cache using a key prefix. Or do i have to use a seperate database for every installation? |
Routine in python to test for a string if has a *nix valid absolute path? | 12,057,654 | 0 | 0 | 334 | 0 | python,python-2.7,filepath | If I understand you, your first example IS an absolute path. All absolute paths will start with a "/" as they must start at the root directory, and all relative paths will not. So, just check if your string starts with a "/" using str.startswith('/'). Then, if you want to check if the path is valid, then use os.path.... | 0 | 1 | 0 | 0 | 2012-08-21T14:42:00.000 | 3 | 0 | false | 12,057,379 | 1 | 0 | 0 | 2 | I need a routine in python to test for a string that contains an absolute path, that is Unix style format.
So that /home/eduard/tmp/chrome-data-dir/file.ext would be a valid path.
But C:\Users\user\AppData\Local\Google\Chrome\Application\chrome.exe would not be a valid path.
I need also the path to bet tested not cont... |
Routine in python to test for a string if has a *nix valid absolute path? | 12,057,424 | 0 | 0 | 334 | 0 | python,python-2.7,filepath | Your first example is not a relative path, it's absolute because it begins with /. The second is also absolute, since the first character after the drive name is a \.
A relative path in Unix would be something like chrome-data-dir/file.ext or ../../include/.
Your question is kind of unclear.
Perhaps you should look for... | 0 | 1 | 0 | 0 | 2012-08-21T14:42:00.000 | 3 | 0 | false | 12,057,379 | 1 | 0 | 0 | 2 | I need a routine in python to test for a string that contains an absolute path, that is Unix style format.
So that /home/eduard/tmp/chrome-data-dir/file.ext would be a valid path.
But C:\Users\user\AppData\Local\Google\Chrome\Application\chrome.exe would not be a valid path.
I need also the path to bet tested not cont... |
How can I copy files in Python while keeping their directory structure? | 12,060,469 | 2 | 0 | 3,371 | 0 | python,copy,directory,file-copying | You need to use os.makedirs along side shutil.copytree. | 0 | 1 | 0 | 0 | 2012-08-21T17:53:00.000 | 2 | 0.197375 | false | 12,060,358 | 0 | 0 | 0 | 1 | I have a list of directories which have many sub-directories.
e.x. C:\home\test\myfiles\myfile.txt
I want to copy this to my X: drive. How do I copy myfile.txt if the X: drive only contains X:\\home?
I thought shutil would create necessary directories when copying files but I was wrong and I am not sure what to use.... |
porting python code(linux) to windows | 12,061,400 | 3 | 2 | 1,172 | 0 | python,linux | I only have experience with py2exe and pyqt4, but py2exe needs several dlls which can only exist inside a Windows environment (like Visual C runtime libs or the dlls for Qt). It might be hackable with Wine, but having a Windows environment for packaging everything is the "supported" way. | 0 | 1 | 0 | 0 | 2012-08-21T18:55:00.000 | 2 | 0.291313 | false | 12,061,262 | 1 | 0 | 0 | 1 | i wrote a program using python with PyQT4 and other modules like numpy, scipy etc. under Linux(Ubuntu 9.10). Now i want a executable of this program under Windows 7. I dont want to install Python on the Windows 7 OS.
i try pyinstaller, cx_freeze and py2exe under linux, but i generate only a linux executable which works... |
synchronize two pipelines in gstreamer | 12,079,062 | 3 | 0 | 3,138 | 0 | python,gstreamer | Depends on what you mean by synchronization, what are your sources and what is your pipeline. If both are getting data from different sources unless the sources were synchronized in some form there is no real sense to what you mean by synchronize the two pipelines
If all you want is that they are in lock step with each... | 0 | 1 | 0 | 0 | 2012-08-22T17:04:00.000 | 1 | 0.53705 | false | 12,078,046 | 0 | 0 | 0 | 1 | I am playing 2 videos in two different pipelines of gstreamer. I would like to synchronize both the videos. do any of you have any tips? |
Command Prompt Python | 12,083,132 | 1 | 0 | 271 | 0 | python,terminal,progress-bar,command-prompt | Each IDE is infact interacting via the command line and redirecting streams into it's implementation of showing those outputs, Each IDE has it's own way of doing this, command prompt is more powerful if you are expeirienced and easy to try one off scripts, try ipython which is great for beginners and learners alike fo... | 0 | 1 | 0 | 0 | 2012-08-22T23:46:00.000 | 2 | 0.099668 | false | 12,082,918 | 1 | 0 | 0 | 1 | What is the benefit of running code through the command prompt/terminal vs an ide?
I've noticed recently when using the progressbar module of python that the progress text is updated on the same line in the command prompt window while the ide prints each text on the next line. Why are these different? Are they not run... |
Set up python path in mac osx? | 12,083,839 | 0 | 3 | 14,852 | 0 | python,macos,python-2.7 | If I remember correctly, you may want to do a "sudo port activate python". What does "which python" tell you? If it's /usr/bin/python, you're running OSX Python. If, OTOH, it's /usr/local/bin/python you're probably using the ports version. | 0 | 1 | 0 | 0 | 2012-08-23T01:39:00.000 | 2 | 0 | false | 12,083,640 | 1 | 0 | 0 | 1 | I installed python on mac os (mountain lion) with Macports.
When I run
$python
It gives an error on "cannot import urandom" when I try to import pandas or matplotlib.
If I run
$python 2.7
Everything runs perfectly.
I want to change python to use python2.7 always.
I tried using sudo port select python python27. ... |
Where does os.remove go? | 12,094,678 | 5 | 13 | 7,445 | 0 | python | it just deletes them from the harddrive | 0 | 1 | 0 | 0 | 2012-08-23T15:02:00.000 | 2 | 0.462117 | false | 12,094,663 | 0 | 0 | 0 | 2 | I've been using Python for a long time and have numerous scripts running all over my office. I use a few in particular scripts to back up then delete data. In these script I use os.remove function.
My question is: Where does the os.remove function delete items to?
Does it delete them right off the HD?
I know they don'... |
Where does os.remove go? | 12,094,722 | 24 | 13 | 7,445 | 0 | python | os.remove
will call the operating system's unlink functionality, and delete the file from the disk.
Technically the OS/filesystem probably just marks the sectors as free, and removes the file entry from the directory, but that's up to the filesystem implementation. | 0 | 1 | 0 | 0 | 2012-08-23T15:02:00.000 | 2 | 1.2 | true | 12,094,663 | 0 | 0 | 0 | 2 | I've been using Python for a long time and have numerous scripts running all over my office. I use a few in particular scripts to back up then delete data. In these script I use os.remove function.
My question is: Where does the os.remove function delete items to?
Does it delete them right off the HD?
I know they don'... |
How can I trigger a function anytime there is a new session in a GAE/Python Application? | 12,116,756 | 0 | 0 | 412 | 0 | python,google-app-engine | I am trying to be pretty general here as I don't know whether you are using the default users service or not and I don't know how you are uniquely linking your SessionSupplemental entities to users or whether you even have a way to identify users at this point. I am also assuming you are using some version of webapp as... | 0 | 1 | 0 | 0 | 2012-08-23T19:01:00.000 | 1 | 0 | false | 12,098,358 | 0 | 0 | 1 | 1 | I am a newbie to Google App Engine and Python.
I want to create an entry in a SessionSupplemental table (Kind) anytime a new user accesses the site (regardless of what page they access initially).
How can I do this?
I can imagine that there is a list of standard event triggers in GAE; where would I find these documente... |
how to set python IDLE's default python? | 12,102,132 | 1 | 5 | 1,564 | 0 | python,windows-7 | The IDLE context menu plug-in is registered when you install Python and points to the version of IDLE supplied with the Python installed. (IDLE itself has significant code changes between Python 2 and 3 because it's written in Python and the language changed a lot.) To change it, simply re-install the version of Python... | 0 | 1 | 0 | 0 | 2012-08-24T01:15:00.000 | 1 | 0.197375 | false | 12,102,061 | 1 | 0 | 0 | 1 | I installed python 3.2 and later installed python 2.7. Somehow the IDLE, which I open it by right-click on python file -> Edit with IDLE, are using python 2.7 instead of python 3.2.
It seems that python 2.7 was set as default with IDLE. Even if I changed the PATH environment variable in windows advance setting back to ... |
Executing a python script in a subprocess - with graphics | 12,106,760 | 1 | 0 | 973 | 0 | python,wxpython | I don't no much about wx, I work with jython(python implemented in java and you can use java) and swing. Swing has its own worker thread, and if you do gui updates you wrap your code into a runnable and invoke it with swing.invokelater.
You could see if wx has something like that, if you however are only allowed to man... | 0 | 1 | 0 | 0 | 2012-08-24T08:38:00.000 | 4 | 0.049958 | false | 12,105,855 | 1 | 0 | 0 | 1 | I've seen a lot of stuff about running code in subprocesses or threads, and using the multiprocessing and threading modules it's been really easy. However, doing this in a GUI adds an extra layer of complication.
From what I understand, the GUI classes don't like it if you try and manipulate them from multiple threads ... |
How can use Google App Engine with MS-SQL | 12,116,542 | 0 | 3 | 2,793 | 1 | python,sql-server,google-app-engine | You could, at least in theory, replicate your data from the MS-SQL to the Google Cloud SQL database. It is possible create triggers in the MS-SQL database so that every transaction is reflected on your App Engine application via a REST API you will have to build. | 0 | 1 | 0 | 0 | 2012-08-24T11:45:00.000 | 2 | 0 | false | 12,108,816 | 0 | 0 | 1 | 1 | I use
python 2.7
pyodbc module
google app engine 1.7.1
I can use pydobc with python but the Google App Engine can't load the module. I get a no module named pydobc error.
How can I fix this error or how can use MS-SQL database with my local Google App Engine. |
Read from windows named pipe with cmd.exe or PowerShell or Python | 12,110,714 | 0 | 1 | 4,243 | 0 | python,windows,powershell,command-line,named-pipes | The client can connect to a Windows named pipe as if it was any other file, provided it has been created by another program. The low-level API is CreateFile using ALWAYS_EXISTING, but the ordinary language routines, like Python's open should work. The filename will be \\ server \pipe\ name.
Unlike disk files pipes a... | 0 | 1 | 0 | 0 | 2012-08-24T13:26:00.000 | 2 | 0 | false | 12,110,312 | 1 | 0 | 0 | 1 | I'm looking for a quick way to check which data comes into a named pipe (on windows). Is there any way to do it from cmd.exe or powershell or python? Actually I found only ways to create named pipe and than manipulate it. But how can I open a named pipe created by another program? |
Google App Engine HRD Migration - Data Read Returns Nothing | 12,185,853 | 0 | 0 | 104 | 0 | google-app-engine,python-2.7 | The issue has resolved itself after a few days. Now the app is returning the correct data. It may be just a glitch from the migration. I have another GAE app that's stuck in the middle of the migration. Searching on SO I have found others that are experiencing the same problem. | 0 | 1 | 0 | 0 | 2012-08-24T16:49:00.000 | 1 | 1.2 | true | 12,113,554 | 0 | 0 | 1 | 1 | After following the instruction to migrate from a GAE app from Master/Slave to High Replication Datastore(HRD), the app is returning nothing for datastore read. I am able to see the data using the "Datastore Viewer" and they are there (migrated successfully). I have not changed any code. Just wondering if there's an... |
CherryPy SSL behind Apache | 12,114,468 | 2 | 0 | 435 | 0 | python,ssl,apache2,cherrypy | You cannot do that (nor would I try to). Firstly, Apache will be better for terminating the SSL than CherryPy (if for no other reason, than performance). And secondly, it will simply not work because Apache speaks HTTP and HTTPS is actually HTTP encrypted with SSL, so you need to handle the SSL before you get any HTTP ... | 0 | 1 | 0 | 0 | 2012-08-24T17:42:00.000 | 2 | 0.197375 | false | 12,114,229 | 0 | 0 | 0 | 2 | Is there a way to set up CherryPy to use SSL when running behind Apache2 without configuring Apache2 to do SSL for CherryPy?
I have found multiple tutorials about using SSL with CherryPy and configuring Apache2 to do the SSL work for CherryPy, but I have not been able to find a tutorial that deals with using SSL with C... |
CherryPy SSL behind Apache | 12,115,325 | 3 | 0 | 435 | 0 | python,ssl,apache2,cherrypy | to expound a bit on gcbrizan's answer, you cannot because the first step required to understand an https request is to first decrypt the connection. SSL/TLS work in two modes; tunneling and STARTTLS; in the latter, a normal connection is started, and at some point, once the two parties have established whatever they ... | 0 | 1 | 0 | 0 | 2012-08-24T17:42:00.000 | 2 | 1.2 | true | 12,114,229 | 0 | 0 | 0 | 2 | Is there a way to set up CherryPy to use SSL when running behind Apache2 without configuring Apache2 to do SSL for CherryPy?
I have found multiple tutorials about using SSL with CherryPy and configuring Apache2 to do the SSL work for CherryPy, but I have not been able to find a tutorial that deals with using SSL with C... |
How to determine from a python application if X server/X forwarding is running? | 12,123,998 | 2 | 8 | 8,184 | 0 | python,ssh,pyqt4,xserver | Similar to your xclock solution, I like to run xdpyinfo and see if it returns an error. | 0 | 1 | 0 | 1 | 2012-08-25T14:05:00.000 | 4 | 0.099668 | false | 12,122,671 | 0 | 0 | 0 | 2 | I'm writing a linux application which uses PyQt4 for GUI and which will only be used during remote sessions (ssh -XY / vnc).
So sometimes it may occur that a user will forget to run ssh with X forwarding parameters or X forwarding will be unavailable for some reason. In this case the application crashes badly (unfortun... |
How to determine from a python application if X server/X forwarding is running? | 12,123,396 | 8 | 8 | 8,184 | 0 | python,ssh,pyqt4,xserver | Check to see that the $DISPLAY environment variable is set - if they didn't use ssh -X, it will be empty (instead of containing something like localhost:10). | 0 | 1 | 0 | 1 | 2012-08-25T14:05:00.000 | 4 | 1.2 | true | 12,122,671 | 0 | 0 | 0 | 2 | I'm writing a linux application which uses PyQt4 for GUI and which will only be used during remote sessions (ssh -XY / vnc).
So sometimes it may occur that a user will forget to run ssh with X forwarding parameters or X forwarding will be unavailable for some reason. In this case the application crashes badly (unfortun... |
why am I getting warning: no files found matching 'MANIFEST', 'ChangeLog', 'GPL when mysql-python installs successfully | 12,537,780 | 1 | 1 | 1,106 | 0 | django,virtualenv,mysql-python | Those files aren't important for running MySQLdb, but they should be included, and I'll fix this for the next release if possible. (Fixed in the 1.2.4 betas) | 0 | 1 | 0 | 0 | 2012-08-25T19:10:00.000 | 1 | 1.2 | true | 12,124,852 | 1 | 0 | 0 | 1 | When using pip to install mysql-python in virtualenv on ubuntu, the install goes through successfully but with the following warnings:
warning: no files found matching 'MANIFEST'
warning: no files found matching 'ChangeLog'
warning: no files found matching 'GPL'
Anyone know why? is it something I need to worry about? |
What are some choice Python programming environments? | 12,126,980 | 0 | 0 | 2,952 | 0 | python,development-environment | Don't expect what you'd get from a classical programming language IDE from something having to do with Python. It can't be done due to the dynamic nature of the language and the fact that in order to figure out details such as autocomplete, parameter info or members, an IDE would have, at some point, to run the code - ... | 0 | 1 | 0 | 0 | 2012-08-26T01:15:00.000 | 3 | 0 | false | 12,126,964 | 1 | 0 | 0 | 1 | I'm wondering if there's a more beginner-friendly environment to write Python than a terminal shell. Any suggestions? |
pause system functionality until my python script is done | 12,134,029 | 2 | 0 | 223 | 0 | python,linux,passwords | You want the equivalent of a "modal" window, but this is not (directly) possible in a multiuser, multitasking environment.
The next best thing is to prevent the user from accessing the system. For example, if you create an invisible window as large as the display, that will intercept any mouse events, and whatever is "... | 0 | 1 | 0 | 1 | 2012-08-26T20:57:00.000 | 3 | 0.132549 | false | 12,133,857 | 0 | 0 | 0 | 2 | I have written a simple python script that runs as soon as a certain user on my linux system logs in. It ask's for a password... however the problem is they just exit out of the terminal or minimize it and continue using the computer. So basically it is a password authentication script. So what I am curious about is ho... |
pause system functionality until my python script is done | 12,134,000 | 3 | 0 | 223 | 0 | python,linux,passwords | There will always be a way for the user to get past your script.
Let's assume for a moment that you actually manage to block the X-server, without blocking input to your program (so the user can still enter the password). The user could just alt-f1 out of the X-server to a console and kill "your weird app". If you mana... | 0 | 1 | 0 | 1 | 2012-08-26T20:57:00.000 | 3 | 0.197375 | false | 12,133,857 | 0 | 0 | 0 | 2 | I have written a simple python script that runs as soon as a certain user on my linux system logs in. It ask's for a password... however the problem is they just exit out of the terminal or minimize it and continue using the computer. So basically it is a password authentication script. So what I am curious about is ho... |
Communicating with bash scripts from python | 12,141,142 | 1 | 0 | 479 | 0 | python,windows,bash,mingw | Sure you can communicate between them, just read/write from a file or pair of files (one for Python to write to and the bash script to read from, and the other for the visa-versa situation). | 0 | 1 | 0 | 1 | 2012-08-27T10:52:00.000 | 2 | 1.2 | true | 12,140,608 | 0 | 0 | 0 | 1 | I am running some shell test scripts from a python script under Windows. The shell scripts are testing the functionality of various modules.
The problem that I faced is that some scripts can hang. For this I added a timeout for each script. This timeout has a default value. But this timeout value can be changed by the ... |
is snmp required | 12,147,545 | 1 | 0 | 197 | 0 | python,monitoring,snmp | The SNMP is a standard monitoring (and configuration) tool used widely in managing network devices (but not only). I don't understand your question fully - is it a problem that you cannot use SNMP because device does not support it (what does it support then?) To script anything you have to know what interface is expos... | 0 | 1 | 1 | 0 | 2012-08-27T18:11:00.000 | 2 | 1.2 | true | 12,147,224 | 0 | 0 | 0 | 2 | is snmp really required to manage devices ?
i'd like to script something with python to manage devices (mainly servers), such as disk usage, process list etc.
i'm learning how to do and many article speak about snmp protocole.
I can't use, for example, psutil, or subprocess or os modules, and send information via udp ... |
is snmp required | 12,148,746 | 1 | 0 | 197 | 0 | python,monitoring,snmp | No, it's not required, but your question is sort of like asking if you're required to use http to serve web pages. Technically you don't need it, but if you don't use it you're giving up interoperability with a lot of existing client software. | 0 | 1 | 1 | 0 | 2012-08-27T18:11:00.000 | 2 | 0.099668 | false | 12,147,224 | 0 | 0 | 0 | 2 | is snmp really required to manage devices ?
i'd like to script something with python to manage devices (mainly servers), such as disk usage, process list etc.
i'm learning how to do and many article speak about snmp protocole.
I can't use, for example, psutil, or subprocess or os modules, and send information via udp ... |
Kill a background program from another program | 12,150,416 | 3 | 1 | 121 | 0 | python,linux,background | You can use Python's os.kill to kill a process by its pid, sending a mostly-arbitrary signal to it like SIGTERM or SIGINT. If it won't die, try SIGKILL.
You can look up a process' pid using the pidof program, or if you use subprocess.Popen you can get the pid from the popen object without needing to spawn another subp... | 0 | 1 | 0 | 0 | 2012-08-27T22:09:00.000 | 1 | 1.2 | true | 12,150,321 | 0 | 0 | 0 | 1 | So I'm running a python script:
It starts a logging program in the background
Does a bunch of stuff.
Then stops the logging program.
So I have two questions:
1) I understand to run a background program, I could call:
os.system("test_log_prog &")
but can I also do:
os.system("test_echo_prog > logfile.log &")... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.