Suppose I have a code in which I have a variable a = 3
. I run it and get a result. Next I want to execute the same code again but changing the value of that variable by doing for example a = 7
. I run it again and it turns out that I get the same result as with a = 3
(and it's not because the result is the same in both cases).
It is something that happens to me from time to time and I lose time until I realize that it does not "recognize" the change made despite having saved the file before executing it. However if I restart the environment (Spyder 3), it fixes my problem.
Why might this happen?
Variables are not deleted before each execution.
In order for the variables to be deleted before each execution, go to:
Pulled apart:
And select the box:
If for some reason you don't want it to be a general execution preference, but rather that it applies only to a specific file, you can modify the "Execution configuration per file":
Pulled apart:
And select the box:
I've never worked with that environment, however I think you have to clean the variables for something that has that environment enabled. Look at this link , maybe it can help you.