Newbie: import

7stud bbxx789_05ss at yahoo.com
Wed Apr 18 19:34:56 EDT 2007


Here's an example where you are trying to import a function in one of
your .py files--when that .py file is not in the current directory:


import sys
sys.path.append("/Users/me/2testing/dir1/")
#directory that contains the file

import test1  #name of file without .py extension
test1.greet()




More information about the Python-list mailing list