[Tutor] Adding custom modules to the module index?

Alan Gauld alan.gauld at blueyonder.co.uk
Sat Aug 7 00:49:19 CEST 2004


> 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


More information about the Tutor mailing list