Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- max_mtime = 0
- for dirname,subdirs,files in os.walk('/Users/raynerd/weatherstuff/pictures/'):
- for fname in files:
- full_path = os.path.join(dirname, fname)
- mtime = os.stat(full_path).st_mtime
- if mtime > max_mtime:
- max_mtime = mtime
- max_file = fname
- def get_digits(str1):
- print str1
- print str1
- c = ""
- for i in str1:
- if i.isdigit():
- c += i
- return c
- latest_photo_number = get_digits(str(max_file))
- # latest_photo_number holds the number of the last edited picture.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement