If you’re like me and you always forget to close your files, you can use a do
block as well.
This is similar to python’s with
command:
open("path/to/file.txt", "w") do io
print(io, "hello world")
end
If you’re like me and you always forget to close your files, you can use a do
block as well.
This is similar to python’s with
command:
open("path/to/file.txt", "w") do io
print(io, "hello world")
end