[Tutor] A simple question

Thomi Richards thomi@thomi.imail.net.nz
Tue, 13 Aug 2002 19:46:13 +1200


well, when python looks for modules to import, it scans through all the
directories in the sys.path string.... more than that i cannot tell
you...

:-)

On Tue, 13 Aug 2002 09:33:53 +0200 (MEST) Thus said lumbricus@gmx.net:

> Hi!
>  
> > this is the way i do it:
> > 
> > -----<SNIP>------
> > #!/usr/bin/python 
> > 
> > #above line needed in unix like environs only!
> > 
> > import sys
> > 
> > sys.path[0] = '/home/thomi/custom_python_modules/'
> > 
> > #set the above path to the dir where all my custom modules are
> > 
> > import thomimodule1
> > 
> > ------<SNIP>-----
> > 
> > this does work, ive tried it myself before... sys.path[0] is free,
> > and
> 
> Yes:
> >>> sys.path[0]
> ''
> >>> 
> But _why_?
> Has anybody an explanation?
> 
> > can be used safely, otherwise you'd have to go:
> > 
> > sys.path.append('/home/thomi/custom_python_modules')
> > 
> > hope that helps..
>  
> [ TOFU snipped ]
> 
> puzzled greetings,
> J"o!
> 
> -- 
> 
> -- 
> GMX - Die Kommunikationsplattform im Internet.
> http://www.gmx.net
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor


-- 
This message was brought to you by one bored guy, with nothing better to
do,
And the letter Q.
Thomi Richards,
thomi@imail.net.nz