Created
November 2, 2014 23:25
-
-
Save jayswan/0aef67246f314c19981a to your computer and use it in GitHub Desktop.
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
from collections import namedtuple | |
def d2n(name,d): | |
""" convert dict to namedtuple """ | |
NewClass = namedtuple(name,d.keys()) | |
return NewClass(*d.values()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment