Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- from tkinter import ttk
- Ox = 600
- Oy = 500
- resizable_first = False
- resizable_second = False
- global_DIGIT = None
- global_Button = None
- def show_click():
- global global_DIGIT
- global_DIGIT = entry_button.get()
- stack = [x for x in global_DIGIT if x.isdigit()]
- if len(stack) == len(global_DIGIT):
- print("Число введено верно")
- else:
- pass
- def selected_radioButtom():
- global global_Button
- global_Button = entry_button.get()
- print(global_Button)
- window = Tk()
- label = Label(window, text="This is Label widget", fg='red', font=("Helvetica", 23))
- label.place(x=190, y=50)
- entry_button = Entry(window, text="This is Entry Widget", bd=5)
- entry_button.place(x=190, y=110)
- button = Button(window, text="Расчитать", fg='blue', command=show_click)
- button.place(x=215, y=250)
- v0 = StringVar()
- r1 = Radiobutton(window, text="Все делители числа", variable=v0, value="Все делители числа",
- command=selected_radioButtom)
- r2 = Radiobutton(window, text="Разложить на простые множители", variable=v0, value="Разложить на простые множители",
- command=selected_radioButtom)
- r3 = Radiobutton(window, text="Использовать оба варианта", variable=v0, value="Использовать оба варианта",
- command=selected_radioButtom)
- r1.place(x=215, y=180)
- r2.place(x=215, y=200)
- r3.place(x=215, y=220)
- window.title("Делители числа")
- window.geometry(f"{Ox}x{Oy}")
- window.resizable(resizable_first, resizable_second)
- window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment