30
votes
8answers
25k views

Take a screenshot via a python script. [Linux]

I want to take a screenshot via a python script and unobtrusively save it. I'm only interested in the Linux solution, and should support any X based environment.
54
votes
7answers
68k views

What is the simplest way to SSH using Python?

What is the absolute simplest way to SSH to a remote server from a local Python (3.0) script, supply a login/password, execute a command and print the output to the Python console? I would rather not ...
12
votes
11answers
20k views

extracting text from MS word files in python

for working with MS word files in python, there is python win32 extensions, which can be used in windows. How do I do the same in linux? Is there any library?
35
votes
5answers
13k views

How to terminate a python subprocess launched with shell=True

I'm launching a subprocess with the following command: p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) However, when I try to kill using: p.terminate() or p.kill() The command ...
22
votes
3answers
11k views

How can I listen for 'usb device inserted' events in Linux, in Python?

I'd like to write a Python script for Amarok in Linux to automatically copy the stackoverflow podcast to my player. When I plug in the player, it would mount the drive, copy any pending podcasts, and ...
54
votes
8answers
19k views

How to get console window width in python

Is there a way in python to programmatically determine the width of the console? I mean the number of characters that fits in one line without wrapping, not the pixel width of the window. Edit ...
13
votes
6answers
13k views

What do I need to read Microsoft Access databases using Python?

How can I access Microsoft Access databases in Python? With SQL? I'd prefere a solution that works with Linux, but I could also settle for Windows. I only require read access.
11
votes
11answers
3k views

Sandboxing in Linux

I want to create a Web app which would allow the user to upload some C code, and see the results of its execution (the code would be compiled on the server). The users are untrusted, which obviously ...
11
votes
7answers
3k views

Force another program's standard output to be unbuffered using Python

A python script is controlling an external application on Linux, passing in input via a pipe to the external applications stdin, and reading output via a pipe from the external applications stdout. ...
32
votes
7answers
17k views

Getting MAC Address

I need a cross platform method of determining the MAC address of a computer at run time. For windows the 'wmi' module can be used and the only method under Linux I could find was to run ifconfig and ...
8
votes
5answers
8k views

Uninstall python built from source?

I've installed python 2.6 from source, and somehow later mistakenly installed another python 2.6 from a package manager too. I can't find a way to uninstall a python that was built from source, is ...
22
votes
12answers
7k views

Ensuring a single instance of an application in Linux

I'm working on a GUI application in WxPython, and I am not sure how I can ensure that only one copy of my application is running at any given time on the machine. Due to the nature of the application, ...
32
votes
4answers
10k views

How to make a python, command-line program autocomplete arbitrary things NOT interpreter

I am aware of how to setup autocompletion of python objects in the python interpreter (on unix). Google shows many hits for explanations on how to do this. Unfortunately, there are so many ...
15
votes
7answers
17k views

Compare two images the python/linux way

Trying to solve a problem of preventing duplicate images to be uploaded. I have two JPGs. Looking at them I can see that they are in fact identical. But for some reason they have different file size ...
28
votes
7answers
8k views

Cross-platform space remaining on volume using python

I need a way to determine the space remaining on a disk volume using python on linux, Windows and OS X. I'm currently parsing the output of the various system calls (df, dir) to accomplish this - is ...

1 2 3 4 5 21
15 30 50 per page