import via pathname

passion_to_be_free at passion_to_be_free at
Mon Jun 20 15:31:38 CEST 2005

Okay, so in my li'l python script I'm importing a few 3rd party modules
that I have installed on my comp.  I need to distribute this script to
several other people, but I won't have access to install the modules on
their comp's.  I'm thinking I'll include these modules with my script
and deliver them as a bundle. When I write my script, is there a way to
declare the import statements and specify a relative path to where the
modules are located?

I know this is wrong syntax, but I think it demonstrates what I'm
trying to do:

import myModule path = /modules/myModule
import myModule2 path = /modules/myModule2

Something like that.  Is it possible?


More information about the Python-list mailing list