Hi everybody!
I'm trying to do something in a way that is probably not particularly
wise but at this point I don't know any better, so bear with me.
Suppose in main.py I have the following statements:
myObject = MyObject()
execThis("myObj ect.myCommand() ")
Now suppose the method
def execThis(aComma ndInAString):
exec(aCommandIn AString)
is somewhere "far away" in terms of scope. Somewhere where the code
doesn't know anything about the instance myObject and even less about
its methods and attributes. How do I get myObject.myComm and() properly
executed?
I'm guessing it's about taking a snapshot of or a reference to the
namespace that is correct for the execution of the command, but... is
that the case? And how do I get a handle to that?
Thanks for your help!
Manu
I'm trying to do something in a way that is probably not particularly
wise but at this point I don't know any better, so bear with me.
Suppose in main.py I have the following statements:
myObject = MyObject()
execThis("myObj ect.myCommand() ")
Now suppose the method
def execThis(aComma ndInAString):
exec(aCommandIn AString)
is somewhere "far away" in terms of scope. Somewhere where the code
doesn't know anything about the instance myObject and even less about
its methods and attributes. How do I get myObject.myComm and() properly
executed?
I'm guessing it's about taking a snapshot of or a reference to the
namespace that is correct for the execution of the command, but... is
that the case? And how do I get a handle to that?
Thanks for your help!
Manu
Comment