From syd at plug.ca Mon Dec 3 19:06:31 2007 From: syd at plug.ca (Sydney Weidman) Date: Mon, 03 Dec 2007 18:06:31 -0600 Subject: [Python Wpg] Import a module using a string Message-ID: <1196726791.19544.14.camel@sweidman-laptop> This was not obvious to me, so I thought I'd mention it for the benefit of anyone else who might be trying to do this. I got a bit tired of using the ConfigParser for loading options and decided that I should just import a module that could be specified on the command line. But how can I import a module the name of which I don't know until my script runs? I should have guessed that Python has a way to do this. You use the __import__ builtin function, like so: import sys myconfigfile = sys.argv[1] try: config = __import__(myconfigfile) for i in config.__dict__: print i except ImportError: print "Unable to import configuration file %s" % (myconfigfile,) See help(__import__) for more information. Hope this helps others! Have a great holiday season! - Syd From S.Jolicoeur at nfb.ca Wed Dec 5 10:54:06 2007 From: S.Jolicoeur at nfb.ca (=?iso-8859-1?Q?Jolicoeur_St=E9phane?=) Date: Wed, 5 Dec 2007 10:54:06 -0500 Subject: [Python Wpg] Job posting Message-ID: I've Been having difficulty in getting my job posted on python.org so I am sending it through other channels Thank you , Stephane Jolicoeur Web Applications Analyst `NFB `__ (Montreal, Quebec, Canada) ==================================================================== **Job Description**: We are seeking python web application developpers, to help us take our project through the next release cycle. We would prefer if applicants were able to be on-site, but remote work arrangements can be accomodated. Skills in : * Python * PHP * MySQL * Django are required. The application consist of Django backend that services our PHP front to track and publish our movie extracts online. Some of the tasks involved will consist in writting sevral components for interfacing with statistical packages, stress testing and unit testing. The National Film Board of Canada (NFB) is Canada's public film producer and distributor. **What Python is used for**: Python (Django) is used as the backend administration and webservice to power the PHP frontend. * **Contact**: Stephane Jolicoeur, Web Applications Analyst, senior developper * **E-mail contact**: s.jolicoeur at nfb.ca * **Web**: www.nfb.ca/webextension/hothouse/hothouse4-tube.php -------------- next part -------------- An HTML attachment was scrubbed... URL: