def step_1(): def clicked(): lbl.configure(text=selected.get()) var= selected.get() step=1 counter_click(step,var) selected = IntVar() rad1 = Radiobutton(root,text='Легковой автомобиль', value=1, variable=selected) rad2 = Radiobutton(root,text='Грузовой автомобиль', value=2, variable=selected) rad3 = Radiobutton(root,text='Автобус', value=3, variable=selected) rad4 = Radiobutton(root,text='Микроавтобус', value=4, variable=selected) rad5 = Radiobutton(root,text='Мотоцикл', value=5, variable=selected) btn2 = Button(root, text="Далее", command=lambda: [clicked(),btn3.grid_remove(), btn1.grid_remove(), btn2.grid_remove(), rad1.grid_remove(), rad2.grid_remove(), rad3.grid_remove(), rad4.grid_remove(), rad5.grid_remove(),lbl1.grid_remove(), lbl4.grid_remove(),lbl2.grid_remove(),lbl3.grid_remove(),lbler.grid_remove(), lblT.grid_remove()]) btn1 = Button(root, text="Назад", command=lambda: [ start(), btn3.grid_remove(), btn1.grid_remove(), btn2.grid_remove(), rad1.grid_remove(), rad2.grid_remove(), rad3.grid_remove(), rad4.grid_remove(), rad5.grid_remove(),lbl1.grid_remove(),lbl4.grid_remove(),lbler.grid_remove(), lbl2.grid_remove(),lbl3.grid_remove(),lblT.grid_remove()]) btn3 = Button(root, text="Войти в систему", command=lambda: [ start(), btn3.grid_remove(), btn1.grid_remove(), btn2.grid_remove(), rad1.grid_remove(), rad2.grid_remove(), rad3.grid_remove(), rad4.grid_remove(), rad5.grid_remove(),lbl1.grid_remove(),lbl4.grid_remove(), lbl2.grid_remove(),lbl3.grid_remove(),lblT.grid_remove(), lbler.grid_remove()]) lbl = Label(root) x=1 y=1 rad1.grid(column=x+1, row=y+1, sticky="W") rad2.grid(column=x+1, row=y+2, sticky="W") rad3.grid(column=x+1, row=y+3, sticky="W") rad4.grid(column=x+1, row=y+4, sticky="W") rad5.grid(column=x+1, row=y+5, sticky="W") btn1.grid(column=x+0, row=y+7, sticky="W") btn2.grid(column=x+3, row=y+7, sticky="W") btn3.grid(column=0, row=0, sticky="N",pady=0,padx=0) lbl1 = tk.Label(root, text = '') lbl2 = tk.Label(root, text = 'ТЕСТ', font=("Arial Bold", 15)) lbl3 = tk.Label(root, text = '') lbl4 = tk.Label(root, text = '') lblT = tk.Label(root, text = 'Выберите авто', font=("Arial Bold", 14)) lbler = tk.Label(root, text = f'{text_error}', font=("Arial Bold", 5)) lbl1.grid(column=3, row=0, pady=0,padx=0) lbl2.grid(column=2, row=0, pady=10,padx=0) lbl3.grid(column=2, row=7, pady=0,padx=0) lbl4.grid(column=2, row=8, pady=0,padx=70) lblT.grid(column=2, row=1, pady=15,padx=0,columnspan=4) lbler.grid(column=8, row=1, pady=15,padx=0,columnspan=4) root.update()
def step_2(): def clicked(): lbl.configure(text=selected.get()) var= selected.get() step=2 counter_click(step,var) selected = IntVar() rad1 = Radiobutton(root,text='Брест', value=1, variable=selected) rad2 = Radiobutton(root,text='Урбаны', value=2, variable=selected) rad3 = Radiobutton(root,text='Брузги', value=3, variable=selected) rad4 = Radiobutton(root,text='Котловка', value=4, variable=selected) rad5 = Radiobutton(root,text='Бригоровщина', value=5, variable=selected) btn2 = Button(root, text="Далее", command=lambda: [clicked(), btn1.grid_remove(), btn2.grid_remove(), btn3.grid_remove(), rad1.grid_remove(), rad2.grid_remove(),btn2.grid_remove(), rad3.grid_remove(), rad4.grid_remove(), rad5.grid_remove(),lbl1.grid_remove(), lbl4.grid_remove(),lbl2.grid_remove(),lbl3.grid_remove(),lblT.grid_remove()]) btn1 = Button(root, text="Назад", command=lambda: [step_1(), btn2.grid_remove(), btn1.grid_remove(),btn2.grid_remove(), rad1.grid_remove(), rad2.grid_remove(), rad3.grid_remove(), rad4.grid_remove(), rad5.grid_remove(),lbl1.grid_remove(),lbl4.grid_remove(), lbl2.grid_remove(),lbl3.grid_remove(),lblT.grid_remove()]) btn3 = Button(root, text="Войти в систему", command=lambda: [step_log(), btn2.grid_remove(), btn1.grid_remove(), btn3.grid_remove(), rad1.grid_remove(), rad2.grid_remove(), rad3.grid_remove(), rad4.grid_remove(), rad5.grid_remove(),lbl1.grid_remove(),lbl4.grid_remove(), lblT.grid_remove(), lbl2.grid_remove(),lbl3.grid_remove()]) lbl = Label(root) x=1 y=1 rad1.grid(column=x+1, row=y+1, sticky="W") rad2.grid(column=x+1, row=y+2, sticky="W") rad3.grid(column=x+1, row=y+3, sticky="W") rad4.grid(column=x+1, row=y+4, sticky="W") rad5.grid(column=x+1, row=y+5, sticky="W") btn1.grid(column=x+0, row=y+7, sticky="W") btn2.grid(column=x+3, row=y+7, sticky="W") btn3.grid(column=0, row=0, sticky="N") lbl1 = tk.Label(root, text = '') lbl2 = tk.Label(root, text = 'ТЕСТ', font=("Arial Bold", 15)) lbl3 = tk.Label(root, text = '') lbl4 = tk.Label(root, text = '') lblT = tk.Label(root, text = 'Выберите точку возврата ', font=("Arial Bold", 14)) lbl1.grid(column=5, row=0, pady=0,padx=70) lbl2.grid(column=2, row=0, pady=10,padx=0) lbl3.grid(column=2, row=7, pady=0,padx=0) lbl4.grid(column=2, row=8, pady=0,padx=70) lblT.grid(column=2, row=1, pady=15,padx=0,columnspan=4) root.update()