from tkinter import* def urob(): try: a=int(vstup1.get()) b=int(vstup2.get()) while a!=0: if a>=b: a=a-b else: x=a a=b b=x vystup1.delete(0,END) vystup1.insert(0,str(b)) except: vystup1.delete(0,END) vystup1.insert(0,"CHYBA") def vymaz(): vstup1.delete(0,END) vstup2.delete(0,END) vystup1.delete(0,END) root=Tk() root.title("06-program-2A") text1=Label(root,text="GTV 27.10.2022") text1.grid(row=0,column=0) text2=Label(root,text="a = ") text2.grid(row=1,column=0) text3=Label(root,text="b = ") text3.grid(row=2,column=0) text5=Label(root,text="Výsledok = ") text5.grid(row=4,column=0) vstup1=Entry(root,width=10) vstup1.grid(row=1,column=1) vstup2=Entry(root,width=10) vstup2.grid(row=2,column=1) vystup1=Entry(root,width=20) vystup1.grid(row=4,column=1) tlac1=Button(root,text="Ukonči",width=10,command=root.destroy) tlac1.grid(row=5,column=0) tlac2=Button(root,text="NSD",width=10,command=urob) tlac2.grid(row=6,column=0) tlac3=Button(root,text="Vymaž",width=10,command=vymaz) tlac3.grid(row=5,column=1) root.mainloop()