Skip to content

Instantly share code, notes, and snippets.

@aarong1
Created July 6, 2023 15:40
Show Gist options
  • Save aarong1/5c925d8cc87e2fe7dc7b8c21cbaf368a to your computer and use it in GitHub Desktop.
Save aarong1/5c925d8cc87e2fe7dc7b8c21cbaf368a to your computer and use it in GitHub Desktop.
easy read file wrapping the context handler and closing the connection
def read_file(filename):
with open(filename, 'r') as f:
content = f.read()
f.close()
return content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment