Last active
December 29, 2015 14:29
-
-
Save dogweather/7684045 to your computer and use it in GitHub Desktop.
Read a text file into a string and close the file.
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
with open('file.txt') as f: contents = f.read() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Python 2.6+