python code snippet

python code snippet
class LuaTable:
-- def __init__(self, **argss):
---- self.__dict__ = dict(argss)
player = LuaTable(name = 'p1', hp = 10)
print player.name
print player.hp

dog = LuaTable(name='dog', type='dog')
print dog.name
dog.food = 'bone'

I hate python dict, so make something like lua table.

你可能感兴趣的:(python code snippet)