Python-我看不到我的错误是因为窗口立即消失 [英] Python - I can't see my what my error is because the window disappears immediately

查看:123
本文介绍了Python-我看不到我的错误是因为窗口立即消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Python很陌生,对此问题我感到非常恼火.我不确定是否很重要,但是我使用安装在计算机上的python 2.7.6运行.py文件,而不在任何在线事物或其他程序上使用它.每次遇到错误时,程序都会正常运行,直到出现错误为止,但是窗口消失了,然后我才可能读取错误所代表的内容……无论如何,我一直无法找出原因我的编程是错误的,并且我厌倦了猜测和猜测出什么地方出了问题.如何延长时间以阅读错误消息?或类似的东西?谢谢

I am pretty new to Python and I have been pretty annoyed with this problem. I am not sure if this matters, but I run my .py file with Python 2.7.6 with python installed on my computer, not using it on any online thing or other program. Every time I come across an error, my program works fine until it comes to the error, but the window disappears right before I can possibly read whatever the error said it was... Anyways, I haven't been able to find out what is wrong with my programming, and I am tired of guessing and guessing what is wrong. How can I extend the time so I can read the error message? Or something like that? Thanks

推荐答案

是的,正如@shortfellow所说,从终端运行它应该可以:

Yes, as @shortfellow said, running it from the terminal should work:

python your_file.py

python your_file.py

如果遇到错误时遇到困难,另一个对Python有帮助的技巧是当场使用iPython调试/测试代码.您可以尝试一下.

Another tip that helps in Python, if you are having a hard time with errors, is to use iPython for debugging/testing code on the spot. You can give it a try.

http://ipython.org/

这篇关于Python-我看不到我的错误是因为窗口立即消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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