Last active
January 5, 2019 05:42
-
-
Save tonyin/36bf5a6f6d2bb73ffd0ae772e6e15f1c to your computer and use it in GitHub Desktop.
Python3 helpers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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