run-time inclusion of files

travis+ml-python at subspacefield.org travis+ml-python at subspacefield.org
Sat Sep 5 18:23:03 EDT 2009


Hello,

I was wondering if there was something like Perl's "require" that allows
you to import a file whose name is specified at run-time.  So far I've only
seen imports of modules that are put in the standard module include path.

I'm interested in three seperate problems:

1) being able to import a file that isn't in the standard module include path

2) being able to import a file whose name is specified in a python string

3) being able to reload the file if it changes on disk

I'm pretty sure that the Pylons web framework does all this, and I'm also
pretty sure that there's a simple solution, I am just not aware of what
it is.
-- 
Obama Nation | My emails do not have attachments; it's a digital signature
that your mail program doesn't understand. | http://www.subspacefield.org/~travis/ 
If you are a spammer, please email john at subspacefield.org to get blacklisted.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 850 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20090905/7267694b/attachment.sig>


More information about the Python-list mailing list