Created
November 26, 2012 19:27
-
-
Save nalsi/4150104 to your computer and use it in GitHub Desktop.
Getting properties of all the files in a given folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Creator: Kai Li | |
## Time: 11/26/2012 | |
## Task: Getting properties of all the files in a given folder. | |
import os | |
import os.path | |
import time | |
for f in os.listdir("c:\python27"): | |
print "File :", os.path.basename(f) | |
print "Access time :", time.ctime(os.path.getatime(f)) | |
print "Modified time :", time.ctime(os.path.getmtime(f)) | |
print "Change time :", time.ctime(os.path.getctime(f)) | |
print "Size :", os.path.getsize(f) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment