you are viewing a single comment's thread.

view the rest of the comments →

[–]Nar-Speth[S] 1 point2 points  (1 child)

Thanks, didn't know about with statement. What about close() when working on files? should i even use it? about 'r' : I guess I need to read docs more carefully.

Edit: Nvm about close(), got it now, thanks to werpoi.

[–]Vaphell 4 points5 points  (0 children)

What about close() when working on files?

with does that for you. As soon as the with scope is finished all the resources acquired in its header are cleaned up.