Python:os 模組的常用用法
取得目前工作路徑
os.getcwd()
將路徑設為絕對路徑
os.path.abspath(path)
結合兩個路徑
os.path.join(path1, path2)
建立資料夾
os.mkdir(path)
建立具結構性資料夾
os.makedirs(path, exist_ok=True)
移除檔案
os.remove(path)
重新命名檔案
os.rename(old_name, new_name)
判斷檔案是否存在
os.path.exists(path)
刪除資料夾
os.rmdir(path)
取出路徑下的所有資料夾及檔案
os.walk(path)
1,168 則留言
MichaelNeolo
generic cialis: traitement infection urinaire pharmacie sans ordonnance – peut on acheter des antibiotiques pour chat sans ordonnance en pharmacie
BradleyDit
se puede comprar testogel sin receta comprar omifin farmacia online comprar augmentine plus sin receta
ThomasBoict
cortisone per cani: dona 30 bustine prezzo – sedo calcio inalante
MichaelNeolo
fluomizin Гіvulos se puede comprar sin receta: farmacia guacci vendita online – pague menos farmacia online
Josephmog
peut on acheter en pharmacie du viagra sans ordonnance: cavaillГЁs savon – jasmine generique