Adding the following lines to a new script will clear all variables each time the script is re-run:
from IPython import get_ipython get_ipython().magic('reset -sf')
To make life easy, you can add it to your default template.
In Spyder: Tools>Preferences>Editor>Edit template
Carl Apr 13 '17 at 18:05 2017-04-13 18:05
source share