This is done by using the dot operator. See this link for more info
class Thing(object):
def __init__(self):
pass
x = Thing()
x.attribute = "my attribute"
>>> print (x.attribute)
'my attribute'
2
solved How to add attributes from outside of the class?