How to know/change current directory in Python shell?

后端 未结 7 1996
无人及你
无人及你 2020-11-27 09:27

I am using Python 3.2 on Windows 7. When I open the Python shell, how can I know what the current directory is and how can I change it to another directory where my modules

7条回答
  •  抹茶落季
    2020-11-27 09:53

    If you import os you can use os.getcwd to get the current working directory, and you can use os.chdir to change your directory

提交回复
热议问题