案例展示: # encoding: utf-8 import os path = "d:\\data" # 設(shè)置路徑 dirs = os.listdir(path) # 獲取指定路徑下的文件 for i in dirs: # 循環(huán)讀取路徑下的文件并篩選輸出 if os.path.splitext(i)[1] == ".csv": # 篩選csv文件 print i # 輸出所有的csv文件 --------------------- 作者:戴翔的技術(shù)博客 來(lái)源:CSDN 原文:https://blog.csdn.net/yuanxiang01/article/details/79118113 版權(quán)聲明:本文為博主原創(chuàng)文章,,轉(zhuǎn)載請(qǐng)附上博文鏈接! |
|
來(lái)自: 夢(mèng)寒與鎖夢(mèng) > 《python》