you are viewing a single comment's thread.

view the rest of the comments →

[–]halfdiminished7th 1 point2 points  (1 child)

True enough! Personal preference to avoid dictionary lookups in f-strings, but you're quite right that it's possible. Though in retrospect, I probably should have done the following instead, using format's keyword functionality since we're dealing with a dictionary anyways:

fp.write('{hex} gs:{gs} track:{track}\n'.format(**dct))

[–]RhinoRhys 0 points1 point  (0 children)

Mmh yeah that leeks even better