Skip to content

Instantly share code, notes, and snippets.

@tru
Created February 27, 2014 14:32
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 tru/9251204 to your computer and use it in GitHub Desktop.
Save tru/9251204 to your computer and use it in GitHub Desktop.
Two list comprehensions in a dict comprehension? Why not!
{k: v.strip() for (k, v) in [l.split(':') for l in [l for l in str(data).split("\\r\\n")[1:]] if ":" in l]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment