spyder - clear variable explorer along with variables from memory

后端 未结 4 2147
傲寒
傲寒 2020-12-15 09:37

To clear the console we can use the following command -

import subprocess as sp
tmp = sp.call(\'cls\',shell=True)

However, to remove a vari

4条回答
  •  情深已故
    2020-12-15 09:53

    As explained in the answer provided by Karan Kaw, there is a setting to delete all the variables, regardless of the script you are workin on.

    Do the following (from the drop-downs bar)

    > Tools > Preferences > Run

    and check the Remove all the variables before execution checkbox in the General Setting section. In doing this I use Spyder 3.3.4.

    This completion may be in order if you want all the scripts you work on to be executed with the preventive deletion of all the variables. Hope it helps

提交回复
热议问题