_tkinter.tclerror:预期的浮点数,但获得了“” (当我的变量变为空时)
这是我第一次寻求帮助。我不是真正的专家,所以我希望这不是一个新的问题(对不起,如果是)。 尝试执行一个简单任务(尝试获取变量的Lenght)的程序
if len(str(Precio.get()))>10:
在我
无论如何,
中扣除,我正在使用tkinter。 precio是doubleVar()类型。 每当变量空白时,此错误似乎都会到达。 提前致谢!
this is my first time asking for help. I am not really an expert, so I hope this is not a newby question (sorry if it is).
Anyway, in a program in which I try to do a simple task (trying to get the lenght of a variable) with this expression:
if len(str(Precio.get()))>10:
I get this error:
_tkinter.TclError: expected floating-point number but got ""
As you have already deducted, I´m using Tkinter. Precio is DoubleVar() type.
This error seems to arrive whenever the variable gets empty.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论