[問題] 用 os.system 如何 cd?

看板Python作者 (偽ABJ)時間17年前 (2008/08/31 12:58), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/2 (看更多)
如果想要 cd 的話 用 os.system 似乎行不通 因為 python 是開一個 child process 去 cd… 所以如果想要改變路徑的話 該怎麼下呢? 我試著用 os.chdir 也沒用… 那這 os.chdir 是作啥用的… -- Team Programming Dragon http://graphics.csie.ntu.edu.tw/~jonathan/tpd/ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 58.159.38.90

08/31 13:31, , 1F
os.chdir我的可以 用system的話 C也是開child process
08/31 13:31, 1F
文章代碼(AID): #18kYJvtz (Python)
文章代碼(AID): #18kYJvtz (Python)