{"id":139774,"date":"2019-04-06T10:00:05","date_gmt":"2019-04-06T02:00:05","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=139774"},"modified":"2019-03-18T10:56:25","modified_gmt":"2019-03-18T02:56:25","slug":"python-get-pwd","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/python-get-pwd.html","title":{"rendered":"\u4f7f\u7528Python\u83b7\u53d6\u8bbe\u7f6e\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55"},"content":{"rendered":"
\u5728\u4f7f\u7528Python\u65f6\uff0c\u6709\u65f6\u9700\u8981\u5bf9\u5f53\u524d\u64cd\u4f5c\u7cfb\u7edf\u505a\u76f8\u5e94\u7684\u64cd\u4f5c\uff0c\u6bd4\u5982\u83b7\u53d6\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u3002\u4e0b\u9762\u7b80\u5355\u4ecb\u7ecd\u4e86\u83b7\u53d6\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u548c\u6539\u53d8\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u7684\u65b9\u6cd5\uff0c\u4f9b\u53c2\u8003\u3002<\/p>\n
os.getcwd() #\u7528\u4ee5\u83b7\u53d6\u5f53\u524d\u7684\u5de5\u4f5c\u76ee\u5f55<\/pre>\n<\/div>\n\u6539\u53d8\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55<\/strong><\/span><\/div>\n\nos.chdir(path) #\u7528\u4e8e\u6539\u53d8\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u5230\u6307\u5b9a\u7684\u8def\u5f84<\/pre>\n<\/div>\n\u53c2\u6570\uff1a<\/p>\n
\n
- Path\u00a0 --\u8981\u5207\u6362\u5230\u7684\u8def\u5f84\u3002<\/li>\n<\/ul>\n
\u8fd4\u56de\u503c\uff1a\u5982\u679c\u5141\u8bb8\u8bbf\u95ee\u8fd4\u56deTrue\uff0c\u5426\u5219\u8fd4\u56deFalse\u3002<\/p>\n
\u4f8b\u5b50\uff1a<\/p>\n
\n