defining functions

rweth rweth at cisco.com
Sun Apr 8 02:40:58 EDT 2007


Andre P.S Duarte wrote:
> How do I define a function, then import it, without having to save it
> in lib; like "C:\python25\lib". ?
> 

The best way I have found (in windows ) for permanently extending your
search path for modules is to create the file:
    package.pth
and put your path/s in a line by line format:
     c:\qa\PythonLibs
     c:\qa\PythonUtils

The file needs to be in a location in your install
under the site-packages .. in windows for my system thats:
    C:\Python25\Lib\site-packages\package.pth

After you do that you can put your modules in the paths you define
in the package.pth   file and sys,path will pick up your modules
automatically.




More information about the Python-list mailing list