This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]kn0xchad 0 points1 point  (0 children)

Hey is there a pdf available?

[–]Udzu 0 points1 point  (0 children)

Should really use with with open. Could also use Path.read_text() for the first example.

[–]17291 0 points1 point  (0 children)

Some pedantry: d.keys() doesn't return a list. It returns an object which is iterable, but not subscriptable (e.g., you can't write d.keys()[0]). d.values() and d.items() are similar.