Advertisement
Guest User

Untitled

a guest
Oct 29th, 2011
140
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data Copied
Advertisement