简体   繁体   English

获取 _tkinter.TclError:错误的几何说明符“400*400”

[英]Getting _tkinter.TclError: bad geometry specifier "400*400"

I have this Code:我有这个代码:

from tkinter import *

from tkinter import messagebox
root = Tk()
root.title('Popup')
root.iconbitmap('D:/Test/Hulk.ico')
root.geometry("400*400")
def popup():
    response = messagebox.showinfo("Popup Test...", "Hello Stifler !")
    Label(root, text=response).pack()

Button(root, text="Click Me!", command=popup).pack()
mainloop()

It should be:它应该是:

root.geometry("400x400")

* should be replaced with x . *应替换为x

You have to use the character lowercase 'x' instead of '*' to indicate multiplication.您必须使用小写字符“x”而不是“*”来表示乘法。 It will work..它会工作..

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM