Scott David Daniels wrote:
>      keep = set(['__builtins__', '__doc__', '__name__',
>                  'pywin', 'keep', 'item', 'globs'])  # Faster to test
>      globs = globals()
>      for item in dir():
>          if item not in keep:
>              del globs[item]
>      del globs, item

This did not work, it gave an error saying "NameError: name 'globs' is
not defined".

However, Steven's del globals()[item] did the trick perfectly. Thanks a
million for the replies, both of you.

So can you explain the [] after globals()? How does that work? The help
docs don't mention anything about that in the function.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to