2
我正在使用Python 2.7來顯示2 Checkbuttons
。如果我使用justify = LEFT
它會顯示錯誤"global name 'LEFT' is not defined"
將Tkinter checkbutton文本字符對齊到左側
class simple_ap(Tkinter.Tk):
def __init__(self,parent):
Tkinter.Tk.__init__(self,parent)
self.parent = parent
self.initialize()
def initialize(self):
Checkbutton = Tkinter.Checkbutton(self,text='All_1',width = 50,justify = LEFT)
Checkbutton.grid(column = 0, row = 0)
Checkbutton = Tkinter.Checkbutton (self,text='To_check_for_the_space_between_brackets',width = 50)
Checkbutton.grid(column = 0, row = 8)
if __name__ == "__main__":
app = simple_ap(None)
app.title('my_app')
app.mainloop()
這是用「證明」的正確方法? 我工作過http://www.tutorialspoint.com/python/tk_frame.htm