How do I change the working directory in Python?

前端 未结 14 1564
天涯浪人
天涯浪人 2020-11-22 01:59

cd is the shell command to change the working directory.

How do I change the current working directory in Python?

14条回答
  •  佛祖请我去吃肉
    2020-11-22 02:27

    If you use spyder and love GUI, you can simply click on the folder button on the upper right corner of your screen and navigate through folders/directories you want as current directory. After doing so you can go to the file explorer tab of the window in spyder IDE and you can see all the files/folders present there. to check your current working directory go to the console of spyder IDE and simply type

    pwd
    

    it will print the same path as you have selected before.

提交回复
热议问题