Defining functions in an implementation file

Diez B. Roggisch deets at nospam.web.de
Tue Jul 18 16:00:05 EDT 2006


westymatt schrieb:
> I am fairly new to python and I want to put alot of my functions in
> another python file and import or from it into my script so I can call
> the functions.  How is this done?


import myfilefullofusefulfunctionsandclasses


Works if you have the file

myfilefullofusefulfunctionsandclasses.py

in your PYTHONPATH somewhere - usually, the current dir and some dirs in 
the installation directory.

Diez



More information about the Python-list mailing list