I have an app that creates Python code and runs it. During this process there are two method assignments that I'd like to clear as they create an error in the second run:
push = Writer.Push
...
def appPush(self):
push(self)
dumpRow(self)
...
Writer.Push=appPush
It's a legacy code I have to fix. If you run this more than once, Python announces that there's a recursion.
I've been looking for a way to clear the environment but 'os.system('CLS')' didn't help. How can I clean those assignments?
Thanks.
Edit:
It IS legacy code. I'm not very familiar with it yet. My app creates Python code that contains general stuff (like the bit I've posted above) and a translation of the user's workflow to Python. If the user creates a flow that ends up calling 'appPush', the application has to be restarted after 1 run.
I can add stuff after the above code. What I'm looking for is a way to clear the interpreter's environment from those assignment. Is it possible?