_tkinter.TclError: bad geometry specifier "800×600+300+150"
时间: 2024-01-11 12:02:15 浏览: 466
tk_tools:Python tkinter工具,Python3.6 +
This error occurs when the geometry specifier used to define the size and position of a tkinter window is not formatted correctly. In this case, the "×" symbol used to represent multiplication is not recognized by tkinter as a valid character.
To fix this error, replace the "×" symbol with an asterisk (*) to define the window size and position in the format "widthxheight+x+y", where "width" and "height" represent the dimensions of the window and "x" and "y" represent the position of the window on the screen.
For example, to create a window with a size of 800x600 pixels positioned at (300, 150) on the screen, use the following syntax:
```
root.geometry("800x600+300+150")
```
This should resolve the TclError and properly display the tkinter window.
阅读全文