当前位置:   article > 正文

python tkinter 表格_PythonGUI系列:tkinter之Text制作表格

python tkinter 表格_PythonGUI系列:tkinter之Text制作表格

import tkinter

root = tkinter.Tk()

for r in range(3):

for c in range(3):

index = str(r)+str(c)

name = tkinter.Text(root,width=10,height=2)

if index=='00':

name.insert('end','00')

name.grid(row=r,column=c)

elif index=='01':

name.insert('end','01')

name.grid(row=r,column=c)

elif index=='02':

name.insert('end','02')

name.grid(row=r,column=c)

elif index=='10':

name.insert('end','10')

name.grid(row=r,column=c)

elif index=='11':

name.insert('end','11')

name.grid(row=r,column=c)

elif index=='12':

name.insert('end','12')

name.grid(row=r,column=c)

elif index=='20':

name.insert('end','20')

name.grid(row=r,column=c)

elif index=='21':

name.insert('end','21')

name.grid(row=r,column=c)

elif index=='22':

name.insert('end','22')

name.grid(row=r,column=c)

root.mainloop()

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/喵喵爱编程/article/detail/980537?site=
推荐阅读
相关标签
  

闽ICP备14008679号