![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Mar 2005
Posts: 1
Rep Power: 0
![]() |
python modules
All, I am new to Python and am trying out a few code samples.
When I start Python commandline, it gives me a >>> prompt. Can't I cd onto another directory where my script resides from the >>> prompt? I tried doing it and it does not like it. How do I cd to this directory from my prompt? Or is it not possible? Basically I want to do a import command from the >>> prompt. Thanks |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Mar 2005
Posts: 1
Rep Power: 0
![]() |
As far as I know about changing the directory within the Python interpreter isn't possible.
The solution to this is to be in the working directory where your script is located. Don't quote me on this though.
__________________
Don't just stand there, kill him! |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Feb 2005
Posts: 24
Rep Power: 0
![]() |
You can change the current working directory by doing
>>> import os >>> os.chdir(path) Changing directory shouldn't be necessary, though. Try adding the directory in which your module resides to the PYTHONPATH environment variable. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|