我正在嘗試從 childs 文件夾的子項中獲取根項目文件夾,然后使用 python 代碼保存輸出以進行調試,而不是添加路徑 static我的樹路徑看起來像這樣.├── ChangeLog├── core│ ├── config.py│ ├── models│ ├── common│ │ ├── utils.py│ │ └── templates├── debug│ └── debug.logfileDir = os.path.dirname(os.path.abspath(__file__))parentDir = os.path.dirname(fileDir)print(parentDir) # /home/xxxx/xxx/xxx/xxx/core
如何從子文件夾中獲取根文件夾項目?
慕婉清6462132
2022-05-19 18:49:10