[Tutor] import a module
Christopher Spears
cspears2002 at yahoo.com
Wed Dec 21 19:22:40 CET 2005
I'm feeling a little foolish because I cannot do this.
I created a module called functions (Clever, huh?) at
this path:
C:\Documents and Settings\Christopher Spears\My
Documents\programming\PythonScripts\Part4\Ex07\functions.py
I want to launch IDLE, import the file, and use it. I
tried:
import "C:\Documents and Settings\Christopher
Spears\My
Documents\programming\PythonScripts\Part4\Ex07\functions.py"
However, I keep getting a syntax error on the last
double quote. According to the docs, I might be able
to get Python to find this file by modifying sys.path.
I would prefer not do that because this is just an
exercise out of the Learning Python book.
Thanks!
More information about the Tutor
mailing list