Skip to content

Instantly share code, notes, and snippets.

@tonyin
Last active January 5, 2019 05:42
Show Gist options
  • Save tonyin/36bf5a6f6d2bb73ffd0ae772e6e15f1c to your computer and use it in GitHub Desktop.
Save tonyin/36bf5a6f6d2bb73ffd0ae772e6e15f1c to your computer and use it in GitHub Desktop.
Python3 helpers
def strftime(value, format='%d %b %Y'):
return value.strftime(format)
def strptime(value, format='%Y-%m-%d'):
return datetime.datetime.strptime(value, format)
flatten = lambda l: [item for sublist in l for item in sublist]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment