如何使用 Python 更改當前目錄?


你可以使用 os 模組在 Python 中更改目錄或 cd。它將你想要切換到的目錄的相對/絕對路徑作為輸入。

例如

>>> import os
>>> os.chdir('my_folder')

更新於:2019-12-12

917 閱讀

開啟你的 職業生涯

完成該課程,獲得認證

開始吧
廣告
© . All rights reserved.