Jun-22-2018, 09:03 PM
I would not recommend it - but that will work.
Output:In [1]: for name in list(globals()):
...: if name[0] != '_':
...: del globals()[name]
...:
Of course, that most probably will render your session unusable - even with _
guard
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.