python tkinter pack 同一行_如何使用tkinter pack()方法将小部件放在下一行?

how can i put widget next row using tkinter pack() method?? i used

pack(side= LEFT) but i can't make like my upload picture . pack(side=

LEFT) is only left... i can't put next row widget. i

wonder..

[

]from tkinter import *

app = Tk()

app.title('')

app.geometry("800x1200")

Label(app, text = 'a:').pack(side= LEFT)

a = Entry(app)

a.insert(0, "")

a.pack(side= LEFT)

Label(app, text = 'b:').pack(side= LEFT)

b = Entry(app)

b.insert(0, "")

b.pack(side= LEFT)

Label(app, text = 'c:').pack(side= LEFT)

c = Entry(app)

c.insert(0, "")

c.pack(side= LEFT)

Label(app, text = 'd:').pack(side= LEFT)

d = Entry(app)

d.insert(0, "")

d.pack(side= LEFT)

Label(app, text = 'e:').pack(side= LEFT)

e = Entry(app)

e.insert(0, "")

e.pack(side= LEFT)

Label(app, text = 'f:').pack(side= LEFT)

f = Entry(app)

f.insert(0, "")

f.pack(side= LEFT)

Label(app, text = 'g:').pack(side= LEFT)

g = Entry(app)

g.insert(0, "")

g.pack(side= LEFT)

Label(app, text = 'h:').pack(side= LEFT)

h = Entry(app)

h.insert(0, "")

h.pack(side= LEFT)

Label(app, text = '').pack()

text = Text(app, width=100,height=12)

text.insert('1.0', "text")

text.pack()

Label(app, text = '').pack()

text2 = Text(app, width=100,height=12)

text2.insert('1.0', "text")

text2.pack()

Button(app, text = 'save ').pack()

app.mainloop()Traceback (most recent call last): File "D:/34545.py", line 2, in

Label(app, text = 'a:').pack(side= LEFT) NameError: name 'Label' is not defined

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值