Re: [Pythonmac-SIG] More newbie questions
by Calvin other posts by this author
Aug 29 2004 12:21AM messages near this date
[Pythonmac-SIG] More newbie questions
|
Re: [Pythonmac-SIG] More newbie questions
> This next one is a bit more of an issue, though. How can I get
> imports to work from the command line in IDLE or PythonIDE? I can't
> seem to figure out any way to set the current working directory.
> Trying to put the full path on the command line simply results in an
> error. This might be simple, but it is stumping me and the limited
> documentation doesn't seem to help. Do I have to set the sys.path to
> include my scripts directory (/Users/rodneys/Documents/python)? If
> so, how do I go about this?
My cheap-o answer to this problem is either to use terminal and start
python from the directory where your objects are (my prefered method) or
import os
and os.chdir('your path')
then you can import the objects in that directory. Of course, I did this
from terminal so your mileage may vary.
-calvin
_______________________________________________
Pythonmac-SIG maillist - Pythonmac-SIG@[...].org
http://mail.python.org/mailman/listinfo/pythonmac-sig
Thread:
Rodney Somerstein
Bob Ippolito
Rodney Somerstein
Calvin
Bob Ippolito
|