How to clean Python's environment
<p>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:  </p>

<pre><code>push = Writer.Push  
...  
def appPush(self):
    push(self)
    dumpRow(self)
...  
Writer.Push=appPush
</code></pre>

<p>It's a legacy code I have to fix. If you run this more than once, Python announces that there's a recursion.<br>
I've been looking for a way to clear the environment but 'os.system('CLS')' didn't help. How can I clean those assignments?<br>
Thanks.  </p>

<p>Edit:<br>
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.<br>
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?</p>
