Last active
December 12, 2015 13:39
-
-
Save chirag-v/4780275 to your computer and use it in GitHub Desktop.
with open file as file_stream: (Prefered way)
This file contains hidden or 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('/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