Advertisement
Guest User

Untitled

a guest
Oct 29th, 2011
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. def reset_interpreter(old_globals):
  2. r"""This method will reset a python interpreters globals dictionary with
  3. the one provided as the input parameter.
  4. """
  5.  
  6. for k in globals().keys():
  7. print k
  8. if k == '__builtins__':
  9. continue
  10. else:
  11. try:
  12. del globals()[k]
  13. del locals()[k]
  14. except:
  15. continue
  16. print globals()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement