Skip to content

Instantly share code, notes, and snippets.

@roberthryniewicz
Created June 20, 2012 04:44
Show Gist options
  • Save roberthryniewicz/2958154 to your computer and use it in GitHub Desktop.
Save roberthryniewicz/2958154 to your computer and use it in GitHub Desktop.
Read Text in Python
>>> file = open('temp_file.txt')
>>> text = file.read()
>>> file.close()
>>> print(text)
This is a sample text.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment