run-time inclusion of files

  • Thread starter travis+ml-python
  • Start date
T

travis+ml-python

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 (e-mail address removed) to get blacklisted.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (OpenBSD)

iQIcBAEBAgAGBQJKouTHAAoJEGQVZZEDJt9H6ugP/jSMFjNqAGOqEjpiJppLtZKL
3FLkeMOMohqq21CGyoGef1IgYMTl3eoRT1MrEKlG/Hbd6VY0JLKmQtbSrPvzpqLM
YReSqNpAwY421grNRItv3nnLC+Bu0ZlYgYA/hyvYPPzy6AeRvwZc0fcw5eoF90GA
ZctM58hHRFXTxaiA67VAP1/3O6vd0PlyYwKUsCffRwqiMKUgJtuLVctkd9t+JtPm
BGhqPw/avC6YaMCddA4ufXEJhHUxlqKcI9nlBDnLGhPVdUNc6PtkmfwOMy26gq8l
n5oI/juGTS3bJ+RHXddK1lj7lTuJRaS/uzJ3eEf/WJh2Y8PlBjUNyxcXvdTXjro4
60jbDN9FAfeSIqbjFCsff5xq0MOIqMb/nL6Ih8VXU/lKoEoHAr3auyWImS80TnE5
w57AMZEr5iOIpGwcde2ZPTNNAJm3mIN00KOPeEwz2U9R79xsT5u4z/gcI+FohS+m
S/LQkdguPiR8AHi4x2skaIXt7gOXZXuseVBXq+AGuGJfHdzXLQEg6Jvwwzf2ec+G
43NUnsHEqCI0BlK9pWQXcx3b5VhpcdDVHOv9CskShWOnx61Nr6xz13zPpaRCarp+
xmwAUbHi8kjmLgytfz4/g04LK7VOAkU9+fDKUO1qwIoSDFo7uZ2dpYiAAHJWirdh
a4Wqgf0NW38JcKLKdcFU
=cwhK
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top