¡@

Home 

python Programming Glossary: mtime

How to get file creation & modification date/times in Python?

http://stackoverflow.com/questions/237079/how-to-get-file-creation-modification-date-times-in-python

a couple of choices. For one you can use the os.path.getmtime and os.path.getctime functions import os.path time print last.. os.path time print last modified s time.ctime os.path.getmtime file print created s time.ctime os.path.getctime file Your other.. import os time mode ino dev nlink uid gid size atime mtime ctime os.stat file print last modified s time.ctime mtime Note..

How to delete files with a Python script from a FTP server which are older than 7 days?

http://stackoverflow.com/questions/2867217/how-to-delete-files-with-a-python-script-from-a-ftp-server-which-are-older-than

now time.time for f in os.listdir path if os.stat f .st_mtime now 7 86400 if os.path.isfile f os.remove os.path.join path.. collections FTPDir collections.namedtuple FTPDir name size mtime tree FTPFile collections.namedtuple FTPFile name size mtime.. tree FTPFile collections.namedtuple FTPFile name size mtime class FTPDirectory object def __init__ self path '.' self.dirs..

Directory Listing based on time [duplicate]

http://stackoverflow.com/questions/4500564/directory-listing-based-on-time

returns a file's timestamp. import os def sorted_ls path mtime lambda f os.stat os.path.join path f .st_mtime return list sorted.. path mtime lambda f os.stat os.path.join path f .st_mtime return list sorted os.listdir path key mtime print sorted_ls..

Dynamically loading python source code

http://stackoverflow.com/questions/4514095/dynamically-loading-python-source-code

4 in '.pyc' '.pyo' filename filename 1 yield filename mtimes while 1 for filename in chain iter_module_files extra_files.. filename in chain iter_module_files extra_files or try mtime os.stat filename .st_mtime except OSError continue old_time.. extra_files or try mtime os.stat filename .st_mtime except OSError continue old_time mtimes.get filename if old_time..