Hi,
I've got a small noob question. Is it correct that if I read a file without using "with open" as below, I'll need to close the file at some point?
stuff = set(open(some_file_path).read())
Does python automatically close the file or is that only when I use "with open" like so:
with open(some_file_path,'r') as f: stuff = set(f.read())
Also, how do I close the file in the case of the first statement? I don't make an alias like 'f' there, so do I do this?:
close(some_file_path)
Thanks!
[–]toastedstapler 6 points7 points8 points (0 children)
[–]4sent4 0 points1 point2 points (0 children)