Aug-30-2023, 09:07 PM
(Aug-30-2023, 03:43 PM)menator01 Wrote: One way
import tkinter as tk from tkinter import ttk import os path = os.path.dirname(os.sys.argv[0]) if not path: path = '.' file = f'{path}/country.txt' with open(file, 'r') as lines: country = [line.strip() for line in lines] root = tk.Tk() root.geometry('400x200+300+300') label = tk.Label(root, text='Combobox', font=(None, 14, 'bold')) label.pack(side='top') combobox = ttk.Combobox(root) combobox['values'] = country combobox['font'] = (None, 14, 'normal') combobox.current(0) combobox.pack(fill='x') root.mainloop()
Thank You, values shows nicely in combobox