importing specific module

drs drs at ecp.cc
Tue Jun 17 16:53:49 EDT 2003


I feel like I have seen this answered here, but I am not finding the
discussion, so sorry if this is asked a lot.

I would like to import a specific module which may or may not be on the
path, and because of concerns about duplicate names, changing network
drives, and moving files, I would rather not append sys.path.  So, something
like

>>> import('C:\\path\\to\\some\\module.py')

is what I am looking to do. imp.load_module() seems promising, but the
documentation is going over my head so I am not sure it is appropriate.  Any
suggestions?  Thanks,

-doug






More information about the Python-list mailing list