Created
November 13, 2017 07:05
-
-
Save jaycody/b8db92af8faf9fc02eb9c856ba4f5561 to your computer and use it in GitHub Desktop.
Pythonic file object creation
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
## 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