简体   繁体   English

我应该使用什么代码? sys.exit()或其他未找到的东西?

[英]What code should I use? sys.exit() or some other thing I haven't found?

I'm a high school student in a class that is using Python 2 on Enthought Canopy Windows Edition. 我是一个在Enthought Canopy Windows Edition上使用Python 2的班上的高中学生。 I often get stuck in coding loops, but the only way I can get out is by closing out all forms of open Enthought. 我经常陷入代码循环中,但是我唯一的解决方法是关闭所有形式的开放式Enthought。 Is there any more reliable way to do it? 还有更可靠的方法吗? I've been using sys.exit(0), but it doesn't work correctly, and is leaving my coding in a jam. 我一直在使用sys.exit(0),但是它无法正常工作,并且使我的编码陷入困境。 I can't even test it without it getting me stuck. 没有它,我什至无法测试它。 Anyone know how to fix this issue? 有人知道如何解决此问题吗?

If your code is already running, then you can't reliably type a command to stop it, because the prompt won't necessarily be live then. 如果您的代码已经在运行,则您将无法可靠地键入命令来停止它,因为此时提示不一定会处于活动状态。

Often you can use the Run menu's "Interrupt kernel" command, and you should usually be able to use "Restart kernel", though this doesn't work all the time. 通常,您可以使用“运行”菜单的“中断内核”命令,并且通常应该可以使用“重新启动内核”,尽管这种方法并非始终有效。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我应该将构造函数与HasTraits子类一起使用吗 - should I use constructor with HasTraits subclass 我应该使用哪种EPD发行版? - Which Enthought EPD distribution should I use? 即使我使用的是64位,sys.maxint也会返回对应于32位系统的值 - sys.maxint returns a value corresponding to a 32 bit system even though I am using a 64 bit 我应该安装哪种顶篷分配? - Which enthought canopy distribution should I install? 如何使用Enthought Python Distribution让virtualenv使用正确的sys.path生成Python可执行文件? - How can I get virtualenv to produce Python executables with the correct sys.path using the Enthought Python Distribution? sys.prefix在尝试确定我是否使用User for Enthought Canapy时生成“ Segmentation fault:11” - sys.prefix generates “Segmentation fault: 11” when trying to decide if I am using User for Enthought Canapy 为什么在Canopy的IPython中不能使用NumPy函数? - Why can't I use NumPy functions in Canopy's IPython? 我无法在Enthought Canopy中更新我的Ipython和Examples版本 - I can't update my Ipython and Examples version in Enthought Canopy 在OS X上将MacPorts安装的Python软件包与Enthought(或其他一些)Python一起使用? - Using MacPorts-installed Python packages with Enthought(or some other) Python on OS X? 如何使用带有Enthought Canopy Distribution的Visual Studio混合模式调试器的Python工具? - How can I use the Python Tools for Visual Studio mixed mode debugger with Enthought Canopy Distribution?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM