要清除控制台,我们可以使用以下命令 -
import subprocess as sp tmp = sp.call('cls',shell=True)
但是,要从内存中删除变量,我们通常依赖 -
del
但它们都是变量特定的,因此非常耗时.那么是否有任何通用命令(如clear在MATLAB下)从内存中删除变量,然后从Spyder的Variable Explorer中删除.
clear
python spyder
python ×1
spyder ×1