Skip to content

Instantly share code, notes, and snippets.

@matthewrobertbell
Created February 5, 2012 14:13
Show Gist options
  • Save matthewrobertbell/1745756 to your computer and use it in GitHub Desktop.
Save matthewrobertbell/1745756 to your computer and use it in GitHub Desktop.
try:
date, job_id = open('job_counter.txt').read().split(',')
job_id = int(job_id) + 1
if date != str(datetime.date.today()):
job_id = 1
except:
job_id = 1
open('job_counter.txt', 'w').write('{date},{job_id}'.format(date=datetime.date.today(), job_id=job_id))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment