Read IDL save files into Python

2009-11-23 Thread Thomas Robitaille
I would like to briefly advertise the 0.9.2 release of IDLSave, a package I recently developed to read IDL save files into Python. Installation instructions are available at http://idlsave.sourceforge.net/. Please do not hesitate to submit a bug report if you run into any problems! Cheers, Thomas

Column types with DB API

2009-06-28 Thread Thomas Robitaille
Hi, I'm trying to use DB API compliant database modules (psycopg2,MySQLdb,SQLite) to access SQL databases, and I am trying to determine the type of each column in a table. The DB API defines cursor.description which contains information about the column names and types (once .execute() has been u

multiprocessing and process run time

2009-06-19 Thread Thomas Robitaille
Hi, I'm making use of the multiprocessing module, and I was wondering if there is an easy way to find out how long a given process has been running for. For example, if I do import multiprocessing as mp import time def time_waster(): time.sleep(1000) p = mp.Process(target=time_waster) p.s

Uploading a file using POST

2009-03-18 Thread Thomas Robitaille
Hello, I am trying to upload a binary file (a tar.gz file to be exact) to a web server using POST, from within a python script. At the moment I am trying URL="http://www.whatever.com"; f=open(filename, 'rb') filebody = f.read() f.close() data = {'name':'userfile','file': filebody} u = urllib