fork download
  1. # your code goes here
  2. from tkinter import *
  3. class Appl(Frame):
  4. def __init__(self, master):
  5. super(Appl, self).__init__(master)
  6. self.grid()
  7. self.create_widgets()
  8. def create_widgets(self):
  9. self.one_lbl = Label(self, text = "Делимое")
  10. self.one_lbl.grid(row = 0, column = 0, sticky = W)
  11. self.two_lbl = Label(self, text = "Делитель")
  12. self.two_lbl.grid(row = 0, column = 1, sticky = W)
  13. self.doe_ent = Entry(self)
  14. self.doe_ent.grid(row = 1, column = 0, sticky = W)
  15. self.dtel_ent = Entry(self)
  16. self.dtel_ent.grid(row = 1, column = 1, sticky = W)
  17. self.bttn = Button(self, text = "Result", command = self.logica)
  18. self.bttn.grid(row = 2, column = 0, sticky = W)
  19. self.text = Text(self, width = 100, height = 50, wrap = WORD)
  20. self.text.grid(row = 3, column = 0, columnspan = 3, sticky = W)
  21. def logica(self):
  22. atr_one = self.doe_ent.get()
  23. atr_two = self.dtel_ent.get()
  24. iterat = 0
  25. PER = ("\n")
  26. self.text.delete(0.0, END)
  27. while atr_one != atr_two:
  28. iterat += 1
  29. self.text.insert(0.0, ("ITR=", iterat, atr_one, atr_two))
  30. if atr_one > atr_two:
  31. atr_one = atr_one % atr_two
  32. else:
  33. atr_two = atr_two % atr_one
Success #stdin #stdout 0.04s 26552KB
stdin
Standard input is empty
stdout
Standard output is empty