xxxxxxxxxx
with open("hello.txt") as my_file:
print(my_file.read())
# Output :
# Hello world
# I hope you're doing well today
# This is a text file
xxxxxxxxxx
# using with statement
with open('file_path', 'w') as file:
file.write('hello world !')
#https://www.geeksforgeeks.org/with-statement-in-python/