Python3 獲取絕對路徑

Python3 獲取絕對路徑 import os os.path.abspath(’.’) # 當前所處的文件夾的絕對路徑,如/usr/local os.path.abspath(’…’) # 當前所處的文件夾上一級文件夾的絕對路徑 os.path.abspath(os.path.dirname(file)) # 當前文件所在絕對路徑 os.path.abspath(os.path.dirname
相關文章
相關標籤/搜索