Clearing pythonwin environment

Network Ninja jeremiah.bess at gmail.com
Thu Jun 22 17:36:08 EDT 2006


I want to restart the environment occasionally to default (like I
restarted pythonwin). I wrote this script. I know why it doesn't work,
cause it deletes my variable (item) on each iteration. My question is:
is it possible to do this? What other things might I try?

# Reset Pythonwin enviroment

# Variables
keep = ['__builtins__', '__doc__', '__name__', 'pywin', 'keep', 'item']

print
for item in dir():
    if item not in keep:
        del item

print
print dir()




More information about the Python-list mailing list