原文:python獲取當前文件路徑以及父文件路徑

當前文件的路徑 pwd os.getcwd 當前文件的父路徑 father path os.path.abspath os.path.dirname pwd os.path.sep . 當前文件的前兩級目錄 grader father os.path.abspath os.path.dirname pwd os.path.sep .. 第一種方法: os.path.abspath file 假設 ...

2019-02-20 19:15 0 5433 推薦指數:

查看詳情

python獲取當前文件路徑以及文件路徑

#當前文件路徑 pwd = os.getcwd() #當前文件路徑 father_path=os.path.abspath(os.path.dirname(pwd)+os.path.sep+".") #當前文件的前兩級目錄 grader_father=os.path.abspath ...

Fri May 05 00:39:00 CST 2017 0 68308
python獲取當前文件路徑以及文件路徑

#當前文件路徑 pwd = os.getcwd() #當前文件路徑 father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "." ) #當前文件的前兩級目錄 ...

Mon Oct 09 19:12:00 CST 2017 0 1457
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM