Lets say that you are in directory "C:\\Python25" and you want to
import function "bar" defined in module "foo" located in your windows
desktop.
You do it like this:
>>import sys
sys.path.append('C:\\Users\\You\\Desktop')
from foo import blah
So you add your desktop to "sys.path" and then import the function as
though it is in the same directory.
Hope this helps...
Luis
On 22 oct, 18:38, Kurda Yon <kurda...@yahoo.comwrote:
Hi,
I would like to import a function from a file which is located not in
the same directory as the main program (from which the function needed
to be imported).
Could anybody pleas tell me how to do that?
Thank you in advance.