Spyder在运行时一直显示旧代码 [英] Spyder keeps displaying old code when Run

查看:101
本文介绍了Spyder在运行时一直显示旧代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我更新了我的代码,保存了它,然后当我尝试运行它时,我不断得到不再存在的旧代码.我重新启动了会话并删除了旧文件并创建了一个新文件......仍在发生.有任何想法吗?提前致谢.

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.

推荐答案

尝试选择:在运行下的专用控制台中执行 --> 每次执行 Demo.py 程序时,Configure 都会启动一个新的 IPython 控制台.这种模式在当前控制台中的 Execute 上的主要用途是,我们可以确定在此控制台中没有定义来自调试和重复执行代码的全局对象.每次我们在编辑器中运行代码时,运行代码的 IPython 控制台都会重新启动.

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.

如果它与某些现有值有关,您可以通过以下方式清除:def clear_all()

If it related to some existing values you can clear by : def clear_all()

这篇关于Spyder在运行时一直显示旧代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆