with open("poem.txt") as f:
    print("file is now open")
    # some more python commands
# now automatically closed!
print("file is now closed")
# other code
