Skip to content

Instantly share code, notes, and snippets.

@connectthefuture
Forked from kennethreitz/t.py
Created September 12, 2016 21:58
Show Gist options
  • Save connectthefuture/7ed33d9b348002d7879df6d0c2132591 to your computer and use it in GitHub Desktop.
Save connectthefuture/7ed33d9b348002d7879df6d0c2132591 to your computer and use it in GitHub Desktop.
def dictify(s):
items = s.split()
for i, item in enumerate(items):
if ':' in item:
items[i] = item.split(':')
else:
items[i] = (item, True)
print dict(items)
s = 'foo bar:baz'
print dictify(s)
@connectthefuture
Copy link
Author

I need to apply this and review my outcomes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment