使用 pathlib.Path() 或 os.scandir() 來替代 os.listdir() 是獲取目錄列表的首選方法,尤其是當你需要獲取文件類型和文件屬性信息的時候。 pathlib.
確定! 回上一頁