Created
September 12, 2018 20:39
-
-
Save DevanR/73db4e301a235170792a167bd826b583 to your computer and use it in GitHub Desktop.
Converting tuples to dicts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tuple = ('71.201.176.194', '-', '-', '26/Feb/2008:10:30:08 -0600', | |
'GET', '/ply/ply.html', 'HTTP/1.1', '200', '97238') | |
colnames = ('host','referrer','user','datetime', | |
'method','request','proto','status','bytes') | |
dict = (dict(zip(colnames,t)) for t in tuples) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment