Гуглил весь день, не нашёл ничего похожего
from datetime import* from time import* from configparser import* from tkinter import* from tkinter import ttk def main(): cont.grid(column=1, padx=50) dateLabel.grid(row=1, column=1, pady=10) authorLabel.grid(row=2, column=1, pady=10) authorsList.grid(row=3, column=1, pady=10) authorsList.set(authors[0]) addAuthorButton.grid(row=3, column=2) bookLabel.grid(row=4, column=1, pady=20) booksList.grid(row=5, column=1, pady=10) addBookButton.grid(row=5, column=2) root.mainloop() def createRoot(): global root, ws, hs root = Tk() w = 400 h = 500 ws = root.winfo_screenwidth() hs = root.winfo_screenheight() x = (ws/2) - (w/2) y = (hs/2) - (h/2) root.geometry('%dx%d+%d+%d' % (w, h, x, y)) root.resizable(False,False) root.title("Reader's diary") def addAuthor(event, name): config = ConfigParser() config.read('journal.ini') numOfAuthor = len(config.options('AUTHORS'))+1 config.set('AUTHORS',('author'+str(numOfAuthor)), str(name)) with open('journal.ini', 'w') as configfile: config.write(configfile) handler = iniHandler() handler.getAuthors() print(name) print(authors) def addAuthorCreateWin(event): addAuthorWin = Toplevel() addAuthorWin.title("New author") inputedName = None x = (ws/2) - 120 y = (hs/2) - 100 addAuthorWin.tkraise() addAuthorWin.resizable(False, False) addAuthorWin.geometry('%dx%d+%d+%d' % (240, 200, x, y)) addAuthorWin.focus() addAuthorWin.grab_set() nameOfAuthor = Label(addAuthorWin ,text='Имя автора:', font='Helvetica 16') inputName = Entry(addAuthorWin ,width=16,font='Helvetica 16') add = ttk.Button(addAuthorWin ,text='Добавить') cancel = ttk.Button(addAuthorWin ,text='Отмена', command=addAuthorWin.destroy) nameOfAuthor.place(anchor="center", relx=0.5, rely=0.2) inputName.place(anchor="center", relx=0.5, rely=0.45) add.place(anchor="center", relx=0.25, rely=0.85) cancel.place(anchor="center", relx=0.8, rely=0.85) inputName.bind("<Return>", lambda event: addAuthor(event, inputName)) add.bind("<ButtonRelease-1>", lambda event: addAuthor(event, inputName)) inputName.focus() class iniHandler(): def getAuthors(self): config = ConfigParser() config.read('journal.ini') global authors authors = [] for i in range (len(config.options('AUTHORS'))): authors.append(config.get('AUTHORS', 'author'+str(i+1))) authorsList.set(authors[-1]) def getBooks(self): config = ConfigParser() config.read('journal.ini') global books books = [] createRoot() date = datetime.date(datetime.today()) cont = Frame(root) authorsList = ttk.Combobox(cont, font='Helvetica 16') dateLabel = Label(cont, text="Cегодня "+str(date), font='Helvetica 16') authorLabel = Label(cont, text='Автор:', font='Helvetica 16') addAuthorButton = ttk.Button(cont, text='Добавить') bookLabel = Label(cont, text='Произведение:', font='Helvetica 16') booksList = ttk.Combobox(cont, values=["1","2"], font='Helvetica 16') addBookButton = ttk.Button(cont, text='Добавить') addAuthorButton.bind("<Button-1>", addAuthorCreateWin) handler = iniHandler() handler.getAuthors() authorsList["values"] = authors main()