mac python3獲取當前腳本路徑

  腳本使用環境:Mac osXpython 使用變量  __file__    spa 代碼以下:code #!/usr/bin/python3 abs_file = __file__ # output current file's directory, like: '/aaa/xxx/Desktop/ex.py' print(abs_file) # get path , like:
相關文章
相關標籤/搜索