运行python代码时出现奇怪的问题 [英] Strange problem when running python code

查看:102
本文介绍了运行python代码时出现奇怪的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好吧


我一直用Python编写我的第一个应用程序,一切都是

运行顺利,除了出现一个奇怪的问题每隔一段时间就会上涨

。我确定每个经验丰富的程序员都知道这种新手的好处。


有时会从部分代码中接收到奇怪的语法错误

几分钟前完美运作。更令人费解的是,当我做一些随机的时候,那些

错误指向模块的另一部分,

代码中的无效变化(比如插入一个排除或删除一些

评论)。有时这些更改足以让错误消失

dissapear。


可能是因为python发现了一个真正的错误但是没有告诉

我在哪里?

解决方案

对于某些错误,如语法错误,你会得到更多帮助

如果您发布一些实际代码,请回复。如果你不得不把它剥掉,请确保我们可以重现错误。


-

Brian Beck

第一顺序的冒险家


ishtar2020写道:

大家好

有时会从几分钟前完美工作的部分代码中收到奇怪的语法错误。更令人费解的是,当我在代码中做一些随机的,无意义的变化(比如插入一行或删除一些
)时,那些
错误指向模块的另一部分。评论)。有时候这些变化足以让错误消失了。

可能是python发现了一个真正的错误,但未能告诉我它在哪里?



我最近有一个缩进问题很麻烦,所以你可能会想要检查你的空白。


ishtar2020< is ******** @ hotmail.com>写道:

我一直在用Python编写我的第一个应用程序,一切都运行得很顺利,除了一段时间内每次弹出一个奇怪的问题。我很确定每个经验丰富的程序员都知道新手的事情。




这里没有人有水晶球。请发布您的代码,告诉我们您所做的更改
,并剪切并粘贴整个错误消息以及

相关的堆栈跟踪。


Hi everybody

I''ve been writing my very first application in Python and everything is
running smoothly, except for a strange problem that pops up every once
in a while. I''m sure is the kind
of newbie thing every seasoned programmer knows.

Sometimes a receive strange Syntax Errors from parts of code that
worked perfectly minutes ago. What''s even more puzzling is that those
errors are pointed to another part of the module when I do some random,
innofensive changes in the code (like inserting a line or deleting some
comments). Sometimes those changes are enough to make the error
dissapear.

Could it be that python has found a real error but is failing to tell
me where it is?

解决方案

For certain errors like Syntax Errors, you''ll get a much more helpful
response if you post some actual code. Strip it down if you have to,
but make sure we can reproduce the errors.

--
Brian Beck
Adventurer of the First Order


ishtar2020 wrote:

Hi everybody

I''ve been writing my very first application in Python and everything is
running smoothly, except for a strange problem that pops up every once
in a while. I''m sure is the kind
of newbie thing every seasoned programmer knows.

Sometimes a receive strange Syntax Errors from parts of code that
worked perfectly minutes ago. What''s even more puzzling is that those
errors are pointed to another part of the module when I do some random,
innofensive changes in the code (like inserting a line or deleting some
comments). Sometimes those changes are enough to make the error
dissapear.

Could it be that python has found a real error but is failing to tell
me where it is?



I recently had quite a hassle with an indentation problem, so you might
want to check on your whitespace.


ishtar2020 <is********@hotmail.com> wrote:

I''ve been writing my very first application in Python and everything is
running smoothly, except for a strange problem that pops up every once
in a while. I''m sure is the kind
of newbie thing every seasoned programmer knows.



Nobody here has a crystal ball. Please post your code, tell us what
changes you made, and cut-and-paste the entire error message and the
associated stack trace.


这篇关于运行python代码时出现奇怪的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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