How to pass values from a group of object attributes into tkinter combobox values

How to pass values from a group of object attributes into tkinter combobox values

I'm looking to populate a tkinter combobox with a list of attribute values contained within a set of objects from a certain class. I have a method that works but it seems inefficient as the number of objects rises.

I'm looking to populate a tkinter combobox with a list of attribute values contained within a set of objects from a certain class. I have a method that works but it seems inefficient as the number of objects rises.

I've attempted using while/for statements but am perhaps failing in syntax due to the formatting for tkinter values.

class Customer:
def __init__(self, name, people):
    self.name = name
    self.people = people

customer1 = Customer("First Customer", ["Brian", "Sally"]) customer2 = Customer("Second Customer", ["Kevin", "James"]) customer3 = Customer("Third Customer", ["Peter", "Sarah"])

customer_list = [customer1, customer2, customer3]

from tkinter import * from tkinter.ttk import *

window = Tk() window.title("Command Console") window.geometry('350x200')

l1 = Label(window, text = "Select a customer.") l1.grid(column=0,row=0)

b1 = Button(window, text = "Grab") b1.grid(column=1,row=1)

c1 = Combobox(window) c1['values'] = customer_list[0].name, customer_list[1].name, customer_list[2].name c1.grid(column=0,row=1)

Although the above works, it would be preferred to populate the .name values for i = 0 to i < len(customer_list) or similar, however I can't work out a mechanism.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Top Python Development Companies | Hire Python Developers

After analyzing clients and market requirements, TopDevelopers has come up with the list of the best Python service providers. These top-rated Python developers are widely appreciated for their professionalism in handling diverse projects. When...

Python GUI Programming Projects using Tkinter and Python 3

Python GUI Programming Projects using Tkinter and Python 3

Guide to Python Programming Language

Guide to Python Programming Language