Skip to content

Instantly share code, notes, and snippets.

@studiawan
Created September 22, 2014 00:27
Show Gist options
  • Save studiawan/ce4d3c2dcbdc440c4020 to your computer and use it in GitHub Desktop.
Save studiawan/ce4d3c2dcbdc440c4020 to your computer and use it in GitHub Desktop.
Read file using "with" statement
# read file without close, with statement will close it for us :)
with open('submission.html', 'r') as f:
text = f.read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment