The functions are contained in module os. Function os.path.getmtime() gives you the last modified time in seconds since the beginning of 1/1/1970 (epoch). You have to do some formatting with module time functions to make it readable for the ordinary mortal.
The size of the file is returned by os.path.getsize() in bytes, convert to kilobytes and format the result.
# pick a file you have in the working folder ...
fname = "Texture.py"
print "File was last modified (12 hour format):"
print time.strftime("%m/%d/%Y %I:%M:%S %p",time.localtime(os.path.getmtime(fname)))
fsize = os.path.getsize(fname)
print "size = %0.1f kb" % float(fsize/1000.0)
File was last modified (12 hour format):
01/25/2003 11:38:30 AM
size = 5.8 kb
Similarly function os.path.getatime() gives the last access time.
i am trying to create a library management system which is supposed to be used to store/keep infp for the library and the library members( book title, author, name and picture for borrower and other stuffs). The app has 6 buttons, delete, save, add,previsous,next, and upload( for upload ...