스크립트 수정을 도와주세요.
from tkinter import *
colors = ['red', 'white', 'blue']
def packbox(root):
Label(root, text='Pack').pack()
for color in colors:
row = Frame(root)
lab = Label(row, text=color, relief=RIDGE, width=25)
ent = Entry(row, bg=color, relief=SUNKEN, width=50)
row.pack(side=TOP, expand=YES, fill=BOTH)
lab.pack(side=LEFT, expand=YES, fill=BOTH)
ent.pack(side=RIGHT, expand=YES, fill=BOTH)
root = Tk()
packbox(root)
mainloop()
왼쪽 가장자리에있는 Label 위젯의 텍스트를 정렬하고 싶습니다.
이 시도
Label(root, text='Pack', anchor='w').pack(fill='both')
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다