Python 将Tkinter checkbutton文本字符向左对齐
我正在使用Python2.7显示2个Python 将Tkinter checkbutton文本字符向左对齐,python,python-2.7,tkinter,Python,Python 2.7,Tkinter,我正在使用Python2.7显示2个检查按钮。如果我使用justify=LEFT它会显示一个错误“未定义全局名称'LEFT'” 这是使用“证明”的正确方法吗? 我使用了它似乎是在使用import Tkinter而不是链接的示例中使用的来自Tkinter import*的 您需要使用Tkinter.LEFT class simple_ap(Tkinter.Tk): def __init__(self,parent): Tkinter.Tk.__init__(self,par
检查按钮
。如果我使用justify=LEFT
它会显示一个错误“未定义全局名称'LEFT'”
这是使用“证明”的正确方法吗?
我使用了它似乎是在使用
import Tkinter
而不是链接的示例中使用的来自Tkinter import*的
您需要使用Tkinter.LEFT
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()