defining functions

kyosohma at kyosohma at
Thu Apr 5 20:42:51 CEST 2007

On Apr 5, 1:38 pm, "Andre P.S Duarte" <andre.ditador9... at>
> How do I define a function, then import it, without having to save it
> in lib; like "C:\python25\lib". ?

Defining a function:

def someFunc():
   # do something here

Save the file some place. Import the sys module BEFORE you import your
module. Then enter the following code:


Now import your python module. This will temporarily add that path to
the python path (or is it system path?) for the amount of time it
takes to execute your script.


More information about the Python-list mailing list