Skip to content

Instantly share code, notes, and snippets.

@jorgebastida
Created March 24, 2011 09:45
Show Gist options
  • Save jorgebastida/884808 to your computer and use it in GitHub Desktop.
Save jorgebastida/884808 to your computer and use it in GitHub Desktop.
>>> a = "Ciudad south=Enolmu east=Dixu west=Dodala north=Trololo"
>>> dict([direction.split('=') for direction in a.split()[1:]])
{'west': 'Dodala', 'east': 'Dixu', 'north': 'Trololo', 'south': 'Enolmu'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment