可不可以将下列python 代码再次封装为一个函数 要怎么做? 5
fromtkinterimport*root=Tk()ScreenWidth=root.winfo_width()ScreeHeingt=root.winfo_heigh...
from tkinter import *
root = Tk()
ScreenWidth = root.winfo_width()
ScreeHeingt = root.winfo_height()
root.title("ChessPlay")
kuan = width = 0
gao = Height = 0
x = (ScreenWidth - width) / 4
y = (ScreeHeingt - Height) / 2
root.geometry("%dx%d+%d+%d" % (width, Height, x, y))
root.mainloop()
请问可否将这段代码 再次封装成为一个 window 函数 尝试几次都失败了 展开
root = Tk()
ScreenWidth = root.winfo_width()
ScreeHeingt = root.winfo_height()
root.title("ChessPlay")
kuan = width = 0
gao = Height = 0
x = (ScreenWidth - width) / 4
y = (ScreeHeingt - Height) / 2
root.geometry("%dx%d+%d+%d" % (width, Height, x, y))
root.mainloop()
请问可否将这段代码 再次封装成为一个 window 函数 尝试几次都失败了 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询