[Tutor] Adding custom modules to the module index?

f2001847 at bits-pilani.ac.in f2001847 at bits-pilani.ac.in
Sat Aug 7 08:09:01 CEST 2004

         if ur using windows then just create a file with extension .pth 
and in that file each line should contain the directory in which ur 
modules are located.This way u can import all the modules in different 
directories. File with .pth extension should be created in ur python 
directory(directory where python was installed).
> > How do you add custom modules so that you are able to import them
> > directly from python?
> Basically you create a file and save it someplace thats in 
> your PYTHONPATH environment variable or within the sys.path
> variable.
> > I've read that its possible to add your own modules so they can be
> > imported from IDLE like above, I just cannot remember how!? 
> Its covered in my tutorial under functions and modules.
> Setting the PYTHONPATH environment variable is OS dependant
> but should be easy to find. If not get back to us and we can 
> probably help if you tell us which OS you use.
> Alan G
> Author of the Learn to Program web tutor
> http://www.freenetpages.co.uk/hp/alan.gauld/tutor2
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor

More information about the Tutor mailing list