Skip to content

Instantly share code, notes, and snippets.

@twmht
Last active January 9, 2016 07:30
Show Gist options
  • Save twmht/f2af6c8c58b6107a1ddc to your computer and use it in GitHub Desktop.
Save twmht/f2af6c8c58b6107a1ddc to your computer and use it in GitHub Desktop.
add random atrtributes
class Struct:
def __init__(self, **entries):
self.__dict__.update(entries)
a = Struct(x = 5,y = 6)
print a.x
print vars(a)
print a.__dict__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment