There is code using the tkinter library:
from tkinter import * import pickle import time import random class MainWindow: def __init__(self): Label(root, text="Set our sets by our own:", font="Arial 14", width=20, height=2, justify=LEFT).grid(column=0, row=2, columnspan=3) Label(root, text='A:').grid(column=0, row=3, sticky=E) Label(root, text='B:').grid(column=0, row=4, sticky=E) Label(root, text='C:').grid(column=0, row=5, sticky=E) Label(root, text='Set our sets by random:', font="Arial 14", width=30, height=2, justify=LEFT)\ .grid(column=0, row=6, columnspan=3) Label(root, text='Amount of A\'s items:').grid(column=0, row=7, sticky=E) Label(root, text='Amount of B\'s items:').grid(column=0, row=8, sticky=E) Label(root, text='Amount of C\'s items:').grid(column=0, row=9, sticky=E) entA = Entry(root, width=30, bd=3, state=DISABLED) entA.grid(column=1, row=3) entB = Entry(root, width=30, bd=3, state=DISABLED) entB.grid(column=1, row=4) entC = Entry(root, width=30, bd=3, state=DISABLED) entC.grid(column=1, row=5) lenA = Entry(root, width=10, bd=3, state=DISABLED) lenA.grid(column=1, row=7, sticky=W) lenB = Entry(root, width=10, bd=3, state=DISABLED) lenB.grid(column=1, row=8, sticky=W) lenC = Entry(root, width=10, bd=3, state=DISABLED) lenC.grid(column=1, row=9, sticky=W) self.create_RadioButtons() def create_RadioButtons(self): var = IntVar() var.set(0) rad0 = Radiobutton(root, text="Вy our own:", variable=var, value=0, command=self.vruchnu) rad1 = Radiobutton(root, text="By random:", variable=var, value=1, command=) rad0.grid(column=0, row=0, columnspan=2, sticky=W) rad1.grid(column=0, row=1, columnspan=2, sticky=W) def vruchnu(self): global A, B, C self.entA['state']=NORMAL entB['state']=NORMAL entC['state']=NORMAL lenA['state']=DISABLED lenB['state']=DISABLED lenC['state']=DISABLED root = Tk() root.title("Laboratory work 1") root.geometry("680x400") obj = MainWindow() root.mainloop() Why in the vruchnu(self) method I do not have access to the variables entA , entB , lenA ?
self.entA, etc - Twissself.entA['state']=NORMAL- Artem Aleksandrovich__init__also do the same instead ofentAchange toself.entA- Twiss