Skip to content

Instantly share code, notes, and snippets.

@studiawan
Last active December 24, 2015 15:19
Show Gist options
  • Save studiawan/6818882 to your computer and use it in GitHub Desktop.
Save studiawan/6818882 to your computer and use it in GitHub Desktop.
Read text file using Python
# very simple way: open-read-close
f = open('textfile.txt', 'r')
data = f.read()
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment