In Spyder, Do following steps
Run
Configuration per file...
Clear all variables before execution [Select Checkbox]
This actually clears variables from previous run of the file. Hope it helps.
Python清理变量 类似Clear all Close all 操作
原文:https://www.cnblogs.com/focus-z/p/11110086.html