改變python的默認(rèn)路徑為當(dāng)前的工作路徑
通過(guò)os模塊來(lái)進(jìn)行python中路徑的更改
默認(rèn)路徑為:
>>>importos
>>>os.getcwd()
'D:\\ProgramFiles\\Python35
跳轉(zhuǎn)到當(dāng)前工作路徑為
>>>os.chdir("D:\ProgramFiles\Python35\modifyPath\test02")
>>>os.getcwd()
'D:\\ProgramFiles\\Python35\\modifyPath\\test02
以上內(nèi)容為大家介紹了python培訓(xùn)之如何設(shè)置路徑,希望對(duì)大家有所幫助,如果想要了解更多Python相關(guān)知識(shí),請(qǐng)關(guān)注IT培訓(xùn)機(jī)構(gòu):千鋒教育。