Advertisement
Guest User

Untitled

a guest
Mar 10th, 2014
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. import os
  2.  
  3. max_mtime = 0
  4. for dirname,subdirs,files in os.walk('/Users/raynerd/weatherstuff/pictures/'):
  5.     for fname in files:
  6.         full_path = os.path.join(dirname, fname)
  7.         mtime = os.stat(full_path).st_mtime
  8.         if mtime > max_mtime:
  9.             max_mtime = mtime
  10.             max_file = fname
  11.  
  12. def get_digits(str1):
  13.     print str1
  14.     print str1
  15.     c = ""
  16.     for i in str1:
  17.         if i.isdigit():
  18.             c += i
  19.     return c
  20.  
  21. latest_photo_number = get_digits(str(max_file))
  22.  
  23. # latest_photo_number holds the number of the last edited picture.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement