import from containing folder

David Isaac aisaac0 at verizon.net
Wed Jul 26 13:39:58 EDT 2006


Alan wrote:
> I do not want to make any assumptions about
> this particular package being on sys.path.
> (I want a relative import, but cannot assume 2.5.)


I should mention that to get around this I have
been using
sys.path.append(os.path.split(sys.argv[0])[0])
in the script I care most about.  It works,
but seems like a hack.

Thanks,
Alan Isaac





More information about the Python-list mailing list