Aug-30-2023, 01:49 PM
hello.
Goal: Insert list of country names, stored in a text file, into the combobox.
Idea, create a list of values-
Sadly, country names shows up vertically, letter by letter, in the combobox.
Looks like there is a newline after each letter? Txt-file attached.
Any fix for that?
Can memory used by the list be released. If yes,how?
thank You.
Goal: Insert list of country names, stored in a text file, into the combobox.
Idea, create a list of values-
Sadly, country names shows up vertically, letter by letter, in the combobox.
Looks like there is a newline after each letter? Txt-file attached.
Any fix for that?
Can memory used by the list be released. If yes,how?
thank You.
import customtkinter import tkinter window = tkinter.Tk() window.geometry(f"{1920}x{1200}") window.minsize(1920, 1200) window.resizable(False, False) window.title("tittel") window.state("normal") def fillcomboland(window): f = open('d:\python311\Scripts\inpland.txt') list = "[" for line in f: line = f.readline() line.strip() list = list + "\"" + line + "\"" + "," f.close() list = list +"\"" +"]" land = customtkinter.CTkComboBox(master=window,values=list,font=("Ariel",14,"bold"),width=200,height=32,border_width=2,corner_radius=10,fg_color="#cdebb0", text_color = "#003300") land.place(x=1140,y=745) fillcomboland(window) TEXT-file: [python]