Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 将Tkinter checkbutton文本字符向左对齐_Python_Python 2.7_Tkinter - Fatal编程技术网

Python 将Tkinter checkbutton文本字符向左对齐

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

我正在使用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,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()