当前位置: 首页>>代码示例>>Python>>正文


Python Tkinter.mainloop方法代码示例

本文整理汇总了Python中Tkinter.mainloop方法的典型用法代码示例。如果您正苦于以下问题:Python Tkinter.mainloop方法的具体用法?Python Tkinter.mainloop怎么用?Python Tkinter.mainloop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tkinter的用法示例。


在下文中一共展示了Tkinter.mainloop方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import mainloop [as 别名]
def __init__(self, imagefileName, title):
		self._root = Tkinter.Toplevel()
		self._root.title(title + ' (' + imagefileName + ')')
		self.image = Tkinter.PhotoImage("LGraph",file=imagefileName)

		Tkinter.Label(self._root, image=self.image).pack(side='top',fill='x')
		# self._root.mainloop() 
开发者ID:rafasashi,项目名称:razzy-spinner,代码行数:9,代码来源:kimmo.py

示例2: _quit

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import mainloop [as 别名]
def _quit():
    root.quit()     # stops mainloop
    root.destroy()  # this is necessary on Windows to prevent
                    # Fatal Python Error: PyEval_RestoreThread: NULL tstate 
开发者ID:its-izhar,项目名称:Emotion-Recognition-Using-SVMs,代码行数:6,代码来源:Emotion Recognition.py

示例3: plot

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import mainloop [as 别名]
def plot(self):
    if len(self.channels) < 1 or len(self.channels) > 2:
      print "The device can either operate as oscilloscope (1 channel) or x-y plotter (2 channels). Please operate accordingly."
      self._quit()
    else:
      print "Plotting will start in a new window..."
      try:
        # Setup Quit button
        button = Tkinter.Button(master=self.root, text='Quit', command=self._quit)
        button.pack(side=Tkinter.BOTTOM)
        # Setup speed and width
        self.scale1 = Tkinter.Scale(master=self.root,label="View Width:", from_=3, to=1000, sliderlength=30, length=self.ax.get_window_extent().width, orient=Tkinter.HORIZONTAL)
        self.scale2 = Tkinter.Scale(master=self.root,label="Generation Speed:", from_=1, to=200, sliderlength=30, length=self.ax.get_window_extent().width, orient=Tkinter.HORIZONTAL)
        self.scale2.pack(side=Tkinter.BOTTOM)
        self.scale1.pack(side=Tkinter.BOTTOM)
        self.scale1.set(4000)
        self.scale2.set(self.scale2['to']-10)
        self.root.protocol("WM_DELETE_WINDOW", self._quit)
        if len(self.channels) == 1:
          self.values = []
        else:
          self.valuesx = [0 for x in range(4000)]
          self.valuesy = [0 for y in range(4000)]
        self.root.after(4000, self.draw)
        Tkinter.mainloop()
      except Exception, err:
        print "Error. Try again."
        print err
        self._quit() 
开发者ID:ankitaggarwal011,项目名称:PiScope,代码行数:31,代码来源:PiScope.py

示例4: run

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import mainloop [as 别名]
def run(self):
        tk.mainloop() 
开发者ID:makelove,项目名称:OpenCV-Python-Tutorial,代码行数:4,代码来源:demo.py

示例5: exitonclick

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import mainloop [as 别名]
def exitonclick(self):
        """Go into mainloop until the mouse is clicked.

        No arguments.

        Bind bye() method to mouseclick on TurtleScreen.
        If "using_IDLE" - value in configuration dictionary is False
        (default value), enter mainloop.
        If IDLE with -n switch (no subprocess) is used, this value should be
        set to True in turtle.cfg. In this case IDLE's mainloop
        is active also for the client script.

        This is a method of the Screen-class and not available for
        TurtleScreen instances.

        Example (for a Screen instance named screen):
        >>> screen.exitonclick()

        """
        def exitGracefully(x, y):
            """Screen.bye() with two dummy-parameters"""
            self.bye()
        self.onclick(exitGracefully)
        if _CFG["using_IDLE"]:
            return
        try:
            mainloop()
        except AttributeError:
            exit(0) 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:31,代码来源:turtle.py

示例6: mainloop

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import mainloop [as 别名]
def mainloop(self):
        Tk.mainloop() 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:4,代码来源:backend_tkagg.py

示例7: disp_plot

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import mainloop [as 别名]
def disp_plot(args=sys.argv):
    disp = Display(args)
    disp.draw_GUI()
    plt.tight_layout()
    disp.root.protocol("WM_DELETE_WINDOW", disp.quit)
    Tk.mainloop() 
开发者ID:mdolab,项目名称:OpenAeroStruct,代码行数:8,代码来源:plot_wingbox.py

示例8: main

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import mainloop [as 别名]
def main(argv):
    op = get_parser()
    opts, args = op.parse_args(argv[1:])
    root = Tk.Tk()
    model = Model()
    controller = Controller(model)
    root.wm_title("Scikit-learn Libsvm GUI")
    view = View(root, controller)
    model.add_observer(view)
    Tk.mainloop()

    if opts.output:
        model.dump_svmlight_file(opts.output) 
开发者ID:jakevdp,项目名称:sklearn_pydata2015,代码行数:15,代码来源:svm_gui.py

示例9: main

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import mainloop [as 别名]
def main():
    print("Loading replay memory...")
    memory = replay_memory.ReplayMemory.create_instance_supervised()

    win = GridAnnotationWindow.create(
        memory,
        current_anno_attribute_name="cars_mirrors_grid",
        save_to_fp="annotations_cars_mirrors.pickle",
        every_nth_example=5
    )
    win.brush_size = 3
    win.autosave_every_nth = 200
    win.master.wm_title("Annotate cars mirrors")

    Tkinter.mainloop() 
开发者ID:aleju,项目名称:self-driving-truck,代码行数:17,代码来源:annotate_cars_mirrors.py

示例10: main

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import mainloop [as 别名]
def main():
    print("Loading replay memory...")
    memory = replay_memory.ReplayMemory.create_instance_supervised()

    win = GridAnnotationWindow.create(
        memory,
        current_anno_attribute_name="current_lane_grid",
        save_to_fp="annotations_current_lane.pickle",
        every_nth_example=20
    )
    win.brush_size = 2
    win.autosave_every_nth = 100
    win.master.wm_title("Annotate current lane")

    Tkinter.mainloop() 
开发者ID:aleju,项目名称:self-driving-truck,代码行数:17,代码来源:annotate_current_lane.py

示例11: main

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import mainloop [as 别名]
def main():
    print("Loading replay memory...")
    memory = replay_memory.ReplayMemory.create_instance_supervised()

    win = GridAnnotationWindow.create(
        memory,
        current_anno_attribute_name="lanes_same_direction_grid",
        save_to_fp="annotations_lanes_same_direction.pickle",
        every_nth_example=20
    )
    win.brush_size = 2
    win.autosave_every_nth = 100
    win.master.wm_title("Annotate lanes same direction")

    Tkinter.mainloop() 
开发者ID:aleju,项目名称:self-driving-truck,代码行数:17,代码来源:annotate_lanes_same_direction.py

示例12: main

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import mainloop [as 别名]
def main():
    print("Loading replay memory...")
    memory = replay_memory.ReplayMemory.create_instance_supervised()

    win = GridAnnotationWindow.create(
        memory,
        current_anno_attribute_name="crashables_grid",
        save_to_fp="annotations_crashables.pickle",
        every_nth_example=20
    )
    win.brush_size = 3
    win.autosave_every_nth = 100
    win.master.wm_title("Annotate crashables")

    Tkinter.mainloop() 
开发者ID:aleju,项目名称:self-driving-truck,代码行数:17,代码来源:annotate_crashables.py

示例13: main

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import mainloop [as 别名]
def main():
    print("Loading replay memory...")
    memory = replay_memory.ReplayMemory.create_instance_supervised()

    win = GridAnnotationWindow.create(
        memory,
        current_anno_attribute_name="cars_grid",
        save_to_fp="annotations_cars.pickle",
        every_nth_example=5
    )
    win.brush_size = 3
    win.autosave_every_nth = 200
    win.master.wm_title("Annotate cars")

    Tkinter.mainloop() 
开发者ID:aleju,项目名称:self-driving-truck,代码行数:17,代码来源:annotate_cars.py

示例14: main

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import mainloop [as 别名]
def main():
    print("Loading replay memory...")
    memory = replay_memory.ReplayMemory.create_instance_supervised()

    win = AttributesAnnotationWindow.create(
        memory,
        save_to_fp="annotations_attributes.pickle",
        every_nth_example=25
    )
    win.autosave_every_nth = 100
    win.master.wm_title("Annotate attributes")

    Tkinter.mainloop() 
开发者ID:aleju,项目名称:self-driving-truck,代码行数:15,代码来源:annotate_attributes.py

示例15: main

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import mainloop [as 别名]
def main():
    print("Loading replay memory...")
    memory = replay_memory.ReplayMemory.create_instance_supervised()

    win = GridAnnotationWindow.create(
        memory,
        current_anno_attribute_name="street_markings_grid",
        save_to_fp="annotations_street_markings.pickle",
        every_nth_example=20
    )
    win.brush_size = 2
    win.autosave_every_nth = 100
    win.master.wm_title("Annotate street markings")

    Tkinter.mainloop() 
开发者ID:aleju,项目名称:self-driving-truck,代码行数:17,代码来源:annotate_street_markings.py


注:本文中的Tkinter.mainloop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。