我有這段代碼,我想讓它在執行命令 mic_press 時發送“b1”b1 = Button(root, image= img1, bd=0, bg='#292424', activebackground='#292424', command=mic_press)
uj5u.com熱心網友回復:
我猜你想要
b1 = Button(root, image= img1, bd=0, bg='#292424', activebackground='#292424', command=lambda:mic_press('b1'))
Tkinter 命令不接受和傳遞任何引數,但您可以使用lambda函式以所需的值呼叫您的方法
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/479815.html
