C# 獲取當前目錄上一級目錄
string path="D:\AA\BB\CC"; Directory.SetCurrentDirectory(Directory.GetParent(path).FullName); p ...
coding:utf import os 獲取當前目錄 print os.getcwd print os.path.abspath os.path.dirname file 獲取上級目錄 print os.path.abspath os.path.dirname os.path.dirname file print os.path.abspath os.path.dirname os.getcw ...
2021-08-13 10:44 0 218 推薦指數:
string path="D:\AA\BB\CC"; Directory.SetCurrentDirectory(Directory.GetParent(path).FullName); p ...
1. os.walk() 用於在目錄樹種游走輸出目錄中的文件名字,向上或下; ...
import osos.path.dirname(os.path.abspath(__file__)) ...
...
Directory.GetParent(System.Environment.CurrentDirectory).FullName ...