问题
I updated my code, saved it and then when I try to run it I keep getting old code that isn't there anymore. I restarted the session and deleted the old file and created a new one...still happening. Any ideas? Thanks in advance.
回答1:
Try selecting : Execute in a dedicated console under Run --> Configure will start a new IPython Console every time the Demo.py program is executed. Main use of this mode over Execute in current console is that we can be certain that there are no global objects defined in this Console which originate from debugging and repeated execution of our code. Every time we run the code in the Editor, the IPython Console in which the code runs is restarted.
If it related to some existing values you can clear by : def clear_all()
来源:https://stackoverflow.com/questions/61643118/spyder-keeps-displaying-old-code-when-run