file
Implements the file based methods.
These are Mojo built-ins, so you don’t need to import them.
For example, here’s how to read a file:
var f = open("my_file.txt", "r")
print(f.read())
f.close()
Or use a with
statement to close the file automatically:
with open("my_file.txt", "r")