On Apr 5, 1:38 pm, "Andre P.S Duarte" <[EMAIL PROTECTED]>
wrote:
> 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:

sys.path.append(r'path\to\yourFile.py')

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.

Mike

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to