python - 获取_tkinter.TclError:错误的几何说明符“400 * 400”
问题描述
我有这个代码:
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()
解决方案
它应该是:
root.geometry("400x400")
*
应替换为x
.
推荐阅读
- c# - 尝试在随机生成 1 或循环 10 次后结束 while 循环
- linux - 微核不更新
- r - xml2 库删除节点:LOGICAL() 只能应用于“逻辑”,而不是“列表”
- excel - 仅用于子行的 Excel 数据透视表计算
- javascript - 如何创建一个带有 li 元素的 ol,这样如果我创建一个文本节点,它可以在 JS 的同一行添加有序数字
- r - R as.POSIXct 和 as.POSIXlt 4 月第一天的不同解析行为,R april 是在愚弄我吗?
- flutter - 无法在 appbar 中放置图像 Flutter web
- reactjs - 尝试更改我设置的 ReactJS 状态数组,但是当我去记录它时,它不会更新,直到我再次运行事件
- ios - 使用 sendToDevice 从 Firebase 功能发送到 iOS 设备时,如何使推送通知正常工作?
- c# - ASP.NET MVC & C#:更好的美元和美分数据输入