Friday, February 1, 2008

Auto Edit File Names

Learned:
  • file operation (import os)
    • time.ctime(os.path.getmtime(filename)) #change machine time to a formatted time.
  • regex in Python (import re)
    • re.match(pattern , string) # pattern comes first!
    • pattern above should follow "r".
  • sort algorithm
  • pad with zeros?
    • "%03i.jpg" - 3-number long with padding with zeros.