Newbie: import

7stud bbxx789_05ss at yahoo.com
Thu Apr 19 01:34:56 CEST 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