Hello everyone is there a better way to dynamically create/call variables, I'm trying to create a structural parser that will read the object data in a block and create those objects as variables dynamically as they are discovered.
This is and example of my current method, but it feels like I'm going about this wrong.
>>> VAR="VAR2"
>>> class item():
... pass
...
>>> newitem=item()
>>> exec('newitem.'+VAR+'=\''+'hello'+'\'')
>>> newitem.VAR2
'hello'
>>>