dopagal.blogg.se

Tkinter python 3 demo
Tkinter python 3 demo










tkinter python 3 demo

tkinter python 3 demo

The tkinter module is part of the standard library. This example opens a blank desktop window. Related course: Python Desktop Apps with Tkinter Example Tkinter module The module Tkinter is an interface to the Tk GUI toolkit. Tk and Tkinter apps can run on most Unix platforms. You can make windows, buttons, show text and images amongst other things. S_save = File_Selector(mo_frame, 'save')ĭ.demo_main_frame.Tkinter is a graphical user interface (GUI) module for Python, you can make desktop apps with Python. "select a file name using the file selection dialog." "Enter a file name in the entry box or click on the \"Browse\" buttons to " Label = Tk.Label(self, text='Select a file to %s: ' % open_save)īutton = Tk.Button(self, text='Browse.', command=(open_save = 'open' and self.open or self.save))įname = fun(filetypes=[('Text files', ('*.txt', '*.doc')), This demonstration script prompts the user to select a file. Label(mo_frame, text="test test test")Ī.demo_main_frame.mainloop()and this named whatever you wish de_buttons = ButtonFrame(de_frame, "Dismiss", de_destroy, "Return Demo",Ĭontent = self.scrolled_text.get('1.0', tk.END)ĭ.demo_(20, d.show_code) Self.scrolled_text.insert(tk.END, ntent0) Self.scrolled_text.pack(fill=tk.BOTH, expand=1) Self.scrolled_text = ScrolledText(de_frame, wrap=tk.WORD) de_window.geometry(left_slide(mo_main_geometry())) mo_buttons.pack(side=tk.BOTTOM, expand=0, pady=5) mo_frame.pack(side=tk.BOTTOM, fill=tk.BOTH, expand=1) mo_main_frame.pack(fill=tk.BOTH, expand=1, padx=3, pady=3) mo_buttons = ButtonFrame(mo_frame, "Dismiss", mo_destroy, "Show Code", self.show_code)

Tkinter python 3 demo code#

""" A class defining demo window and source code window. Tk.Frame._init_(self, master, height=35)ī0 = tk.Button(self, text=b0_text, width=10, command=b0_command)ī1 = tk.Button(self, text=b1_text, width=10, command=b1_command)ĭef _init_(self, master, **key): # justify=tk.LEFT, font=("Helvetica", "12") """ This is a Frame of two common buttons dismess and (see code or return demo) """ĭef _init_(self, master, b0_text, b0_command, b1_text, b1_command): L2 = tk.Label(f, textvariable=var, justify=tk.LEFT, anchor=tk.W, width=20)į.pack(fill=tk.BOTH, anchor=tk.W, padx=20, pady=20)ī = tk.Button(frame, text='OK', command=stroy_window) L1 = tk.Label(f, text=label, justify=tk.LEFT, anchor=tk.W, width=15) L0 = tk.Label(frame, text='Variable values: ', font=('Helvetica', '14'))įor i, (label, var) in enumerate(self.vars): (bottom_slide(mo_window.winfo_geometry(), self.dx)) """ a function class to show variables' value in a separated window """ĭef _init_(self, demo_window, dx, *vars): This is a template for demo codes of Tkinter.įrom tkinter.scrolledtext import ScrolledText

tkinter python 3 demo

Here are two files (still work with python 3.6 with some minor tweeking) that were written for a tkinter demo back in 2005. HashLabel = Label(root, text='MD5 hash:') HashStartButton = Button(root, text='Start', command=dirmd5) When I press the Choose Directory button, the chosen directory should appear in the Entry field, and given to dirmd5 function, and than the calculated hash should be displayed.ĬhooseDirectoryButton = Button(root, text='Choose directory:', command=browse) I'm completely new to Tkinter, could you please help me out, how could I make it work like this: I'd like to have a GUI for a little project, a directory hasher.












Tkinter python 3 demo