Skip to content

Instantly share code, notes, and snippets.

@ErikBoesen
Created March 25, 2022 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ErikBoesen/e9cc9dae6b3b15863461c23c08098faa to your computer and use it in GitHub Desktop.
Save ErikBoesen/e9cc9dae6b3b15863461c23c08098faa to your computer and use it in GitHub Desktop.
with open('/tmp/list', 'r') as f:
l = f.read().strip()
print(l)
for raw in l.split('\n'):
year, name = raw.split(': ')
print("{name: '" + name + "', year: " + year + "},")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment