os 檔案相關應用

檔案相關

當前檔案位置

import os
os.path.realpath(__file__)

資料夾中檔案清單

import os
path = './XXX/'
all_file_name = os.listdir(os.path.dirname(path))

Last updated