이 질문은 물론 질문입니다.Python : 디렉토리의 모든 파일과 폴더 목록, 생성 시간, 마지막 수정 시간을 가져옵니다. 시스템 독립적 인 솔루션?
데이터 파일의 폴더가 있습니다. 나는 다음과 같은 정보 목록의 목록 싶어 : 나는 정보를 한 후
Filename: Created: Last modified:
Information =
[
[datafile1, Mon Mar 04 10:45:24 2013, Tue Mar 05 12:05:09 2013],
[datafile2, Mon Mar 04 11:23:02 2013, Tue Apr 09 10:57:55 2013],
[datafile2.1, Mon Mar 04 11:37:21 2013, Tue Apr 02 15:35:58 2013],
[datafile3, Mon Mar 04 15:36:13 2013, Thu Apr 18 15:03:25 2013],
[datafile4, Mon Mar 11 09:20:08 2013, Mon May 13 16:30:59 2013]
]
은 내가 나 자신을 정렬 할 수 있습니다.
def get_information(directory):
.
.
.
return Information
이 게시물이 유용하다 :
1) How do you get a directory listing sorted by creation date in python?
3) How to get file creation & modification date/times in Python?
4) Python: sort files by datetime in more details
는 사람이 기능을 쓸 수6) How do I get the modified date/time of a file in Python?
그러나 : 나는 윈도우 및 리눅스에서 작동 더 나은, 더 재사용 가능한 솔루션이 존재해야합니다 생각합니다.
http://stackoverflow.com/questions/237079/how-to-get-file-creation-modification-date- times-in-python? rq = 1 –