若要檢查目錄是否存在,則可使用 os.path.isdir ,用法都相同: import os # 要檢查的目錄路徑 folderpath = "/var/log" # 檢查目錄是否存在 if ...
確定! 回上一頁