Select to view content in your preferred language

Method for clearing Python Window in ArcMap programmatically

6642
11
10-19-2018 06:26 AM
DarrenSmith
Regular Contributor

Is there a way of clearing (flushing) the Python Window in ArcMap from Python (that works in 10.2.1)?

0 Kudos
11 Replies
JoshuaBixby
MVP Esteemed Contributor

Just del data, garbage collection will shortly reclaim the memory.

0 Kudos
DanPatterson_Retired
MVP Emeritus

you seem to have missed del

https://community.esri.com/message/807449-re-method-for-clearing-python-window-in-arcmap-programmati... 

and if you want to track and otherwise play with the garbage, look at the gc module

import gc
dir(gc)['DEBUG_COLLECTABLE', 'DEBUG_LEAK', 'DEBUG_SAVEALL', 'DEBUG_STATS',
 'DEBUG_UNCOLLECTABLE', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 
'callbacks', 'collect', 'disable', 'enable', 'garbage', 'get_count', 'get_debug', 
'get_objects', 'get_referents', 'get_referrers', 'get_stats', 'get_threshold',
 'is_tracked', 'isenabled', 'set_debug', 'set_threshold']‍‍‍‍
0 Kudos