Importing at runtime

James Stroud jstroud at mbi.ucla.edu
Tue Oct 25 01:08:14 EDT 2005


exec "import something"

On Monday 24 October 2005 21:53, David Poundall wrote:
> I have several .py files in a directory that I would like to import at
> run time.  Each file contains a state machine that requires to be run
> in its own thread.
>
> The first problem I have is how can I import the code in all of the .py
> files without knowing the file names in advance.
>
> Can this be done ??
>
> TIA

-- 
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/



More information about the Python-list mailing list