Skip to content

Instantly share code, notes, and snippets.

@jaycody
Created November 13, 2017 07:05
Show Gist options
  • Save jaycody/b8db92af8faf9fc02eb9c856ba4f5561 to your computer and use it in GitHub Desktop.
Save jaycody/b8db92af8faf9fc02eb9c856ba4f5561 to your computer and use it in GitHub Desktop.
Pythonic file object creation
## The writable
with open('output.txt', 'w') as f:
f.write('Hi there!')
## we sure about that 'r'???
with open('readthis.txt', 'r') as f:
f.read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment