[英]Maintaining sequence of the read files in a directory with python
我正在嘗試遍歷目錄中的 csv 文件,以便以與目錄中存儲的順序相同的順序讀取它們。 我知道使用os.walk或os.listdir等方法。 為了保留序列,我使用了sorted(os.listdir..)但序列仍然不一樣。 為了便於理解,我附上了兩張圖片。 我現在不想更改文件的名稱,因為這些數據是從不同的模擬軟件生成的。
試試這個語句: sorted(os.listdir(dir_unresolved),key=len)
[英]Python read files in directory and concatenate
[英]read all the files in a directory in python
[英]Read files in Sequence Python-AWS
[英]Maintaining sequence type in set or list comprehension in python
[英]Python: How to read all files in a directory
[英]Python: read files from directory and concatenate that
[英]How to read all new files of a directory with python?
[英]Python: read all files from directory
[英]How to read files in other directory in python
[英]How to read directory and all files inside in Python
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.