Select to view content in your preferred language

Reset / Clear Memory in Python Window

167
2
2 weeks ago
Status: Open
Labels (1)
MatthewLeonard
Frequent Contributor

In the Python Window (not notebook), I want to be able to clear the memory of whatever has been run so far and start with a clean slate (similar to restarting the kernel in notebooks). It seems the only way to do this is to close and reopen Pro, which is very inconvenient. 

I often use the Python Window for experimenting with code, and I often want to start over without variables/functions/etc. already being defined and stored in memory. I can clear the transcript, but this does not clear memory.

I'm honestly surprised this is not already possible.

2 Comments
AdamMesser1

@MatthewLeonard It seems this issue likely faces the same challenge with the python dlls @HannesZiegler mentions in this idea: Reset Kernel without Restarting Pro - Esri Community  It does appear there is progress toward implementation.

BrennanSmith1

Would `globals().clear()` do what you want in the meantime? I don't fully understand what it does, but it did appear to clear any variables or functions I had defined.