how to fill a tkinter dropdown menu iwth the selections of other dropdown menu’s?

I am making a app to help track scores for a card bidding game. (ie I plan to win x rounds or more then play your cards, one after the other highest card wins the round. count the rounds you won. at the end and assign score) there are many players that could participated, but at any given time there are only 4 players that can play a game.

so far I have been able to create 4 dropdown menu’s to select the 4 players that are currently playing. been able to create 4 labels with the starting score (0) and have created a dropdown menu with the names of the bidding games.

now I want to create a dropdown list consisting of the names that are playing. to do this, I added the function playerupdate to be called when a selection is made in one of the four player selection dropdown menu. and this function should then update the the list of names that are playing. but I don’t know how to do this.

from tkinter import *
from tkinter.ttk import *
  
root = Tk() 
frame = Frame(root)
frame.pack()

#set scores function  
def showscore1(): 
    scorelabel1.config(text = score1.get())
def showscore2(): 
    scorelabel2.config(text = score1.get())
def showscore3(): 
    scorelabel3.config(text = score1.get()) 
def showscore4(): 
    scorelabel4.config(text = score1.get()) 
  
# Dropdown menu players
players = [
    "",
    "Lot", 
    "Axel", 
    "Ronnie", 
    "Tom", 
    "Luc", 
    "Bart", 
    "Frans",
    "Pieter",
    "We"
]

#update playermenu
clicked1 = StringVar()  
clicked2 = StringVar()
clicked3 = StringVar()
clicked4 = StringVar()
clicked1.set( "" ) 
clicked2.set( "" )   
clicked3.set( "" )
clicked4.set( "" )


#dropdown menu games:
games = [
    "Rikken",
    "Pieken",
    "Misere",
    "9 alleen",
    "open piek",
    "open misere",
    "10 alleen",
    "11 alleen",
    "12 alleen",
    "13 alleen",
    "schoppen Miën"
]  
selectgame = StringVar()
selectgame.set( "" )


#keeping the score
score1 = IntVar()
score2 = IntVar()
score3 = IntVar()
score4 = IntVar()
score1.set(0)
score2.set(0)
score3.set(0)
score4.set(0)


def playerupdate(player):
  print(player)


#select players
player1 = OptionMenu( frame , clicked1 , *players, command = playerupdate ) 
player1.grid(row = 2, column = 1) 
player2 = OptionMenu( frame , clicked2 , *players, command = playerupdate ) 
player2.grid(row = 2, column = 2)    
player3 = OptionMenu( frame , clicked3 , *players, command = playerupdate ) 
player3.grid(row = 2, column = 3)  
player4 = OptionMenu( frame , clicked4 , *players, command = playerupdate ) 
player4.grid(row = 2, column = 4)




#show score
scorelabel1 = Label(frame, textvariable= score1)
scorelabel1.grid(row = 3, column = 1) 
scorelabel2 = Label(frame, textvariable= score2)
scorelabel2.grid(row = 3, column = 2) 
scorelabel3 = Label(frame, textvariable= score3)
scorelabel3.grid(row = 3, column = 3) 
scorelabel4 = Label(frame, textvariable= score4) 
scorelabel4.grid(row = 3, column = 4)


selectgameplayer = StringVar()
selectgameplayer.set( "" )

gameplayers =[p1,p2,p3,p4,"we"]
gameplayer = OptionMenu( frame, selectgameplayer, *gameplayers)
gameplayer.grid(row = 4, column = 1)

game= OptionMenu( frame , selectgame , *games) 
game.grid(row = 4, column = 4)



# Execute tkinter 
root.mainloop() 

I believe a working solution can be found in the code below. (copied from solution as this seems to do the trick, but have been unable to convert this. for my project. Im getting error message that my objects don’t have an attribute add-command.

this code is working i didn’t added my many trials to conversion.

import tkinter as tk
import time
import calendar

# function to be executed whenever year or month is changed
def on_month_changed(*args):
    # Calculating the number of days in the month (It is done only once using the set value)
    days = calendar.monthrange(year_var.get(), month_var.get())[1]
    # update day OptionMenu
    menu = day['menu']
    # clear current menu
    menu.delete(0, 'end')
    # populate days for selected year and month
    for d in range(1, days+1):
        menu.add_command(label=d, command=tk._setit(day_var, d))
    day_var.set(min(day_var.get(), days))


root = tk.Tk()
root.title("Calendar App")
root.geometry("960x540")

# Defining widgets in root
escape_button = tk.Button(master=root, text="x")
escape_button.grid(row=0, column=0)

title = tk.Label(master=root, text="TEST")
title.grid(row=0, column=1)

frame = tk.LabelFrame(master=root, padx=50, pady=50)
frame.grid(row=1, column=1)

# ------- Year, Month, Day -------

today = time.localtime()

# Label
tk.Label(master=frame, text="Year:").grid(row=0, column=0)
# Defining variable and option menu
year_var = tk.IntVar(value=today.tm_year)
years = range(today.tm_year, today.tm_year+12)
year = tk.OptionMenu(frame, year_var, *years, command=on_month_changed)
year.grid(row=0, column=1)

# label
tk.Label(master=frame, text="Month:").grid(row=0, column=2)
# Defining variable and option menu
month_var = tk.IntVar(value=today.tm_mon)
month = tk.OptionMenu(frame, month_var, *range(1,13), command=on_month_changed)
month.grid(row=0, column=3)

# Label
tk.Label(master=frame, text="Day:").grid(row=0, column=4)
# Defining variable and option menu
day_var = tk.IntVar(value=today.tm_mday)
day = tk.OptionMenu(frame, day_var, None)
day.grid(row=0, column=5)

root.mainloop()

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật