How to access object methods by name?
I have a small question: if i run this:
print(list(globals()))
this is the output:
['__package__', '__loader__', '__doc__', , '__file__', 'b', '__name__',
'__builtins__', 'a']
I want to try a method with all of these elements, especially a and b .
But this would be like:
'a'.run()
so this doesn´t work at all.
i need sth like:
a.run()
thanks for help in advance!
No comments:
Post a Comment