Skip to content

Instantly share code, notes, and snippets.

@chirag-v
Last active December 12, 2015 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chirag-v/4780275 to your computer and use it in GitHub Desktop.
Save chirag-v/4780275 to your computer and use it in GitHub Desktop.
with open file as file_stream: (Prefered way)
with open('/home/user/acetylene.xyz','r') as a_file:
print(a_file.read())
if a_file.closed is True:
print("You won't see this")
if a_file.closed is True:
print ("file is closed now!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment