Прикреплённый файл «tkinterskel.py»

Загрузка

   1 #!/usr/bin/env python3
   2 '''
   3 Tkinter skeleton app
   4 '''
   5 import tkinter as tk
   6 from itertools import product
   7 
   8 class Application(tk.Frame):
   9     '''Sample tkinter application class'''
  10 
  11     def __init__(self, master=None, title="<application>", **kwargs):
  12         '''Create root window with frame, tune weight and resize'''
  13         super().__init__(master, **kwargs)
  14         self.master.title(title)
  15         self.master.columnconfigure(0, weight=1)
  16         self.master.rowconfigure(0, weight=1)
  17         self.grid(sticky="NEWS")
  18         self.create_widgets()
  19         for column in range(self.grid_size()[0]):
  20             self.columnconfigure(column, weight=1)
  21         for row in range(self.grid_size()[1]):
  22             self.rowconfigure(row, weight=1)
  23 
  24     def create_widgets(self):
  25         '''Create all the widgets'''
  26 
  27 class App(Application):
  28     def create_widgets(self):
  29         super().create_widgets()
  30         self.Q = tk.Button(self, text="Quit", command=self.master.quit)
  31         self.Q.grid()
  32 
  33 app = App(title="Sample application")
  34 app.mainloop()

Прикреплённые файлы

Для ссылки на прикреплённый файл в тексте страницы напишите attachment:имяфайла, как показано ниже в списке файлов. Не используйте URL из ссылки «[получить]», так как он чисто внутренний и может измениться.

Вам нельзя прикреплять файлы к этой странице.