How To Add Fuction To Button In Python
Jebbidan
list of my created websites: https://jebbidanyt.000webhostapp.com/ my main website: https://jebbidan.editorx.io/youtube █▓▓▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▓▓█
the code: import PySimpleGUI as gui
def runprog1(msg1): print(msg1) def runprog2(msg2): print(msg2) def runprog3(msg3): print(msg3)
graf = [ [gui.Text("example python application", font=("Arial 20"))], [gui.Text("")], [gui.Button("function 1"), gui.Button("function 2"), gui.Button("function 3")], [gui.Exit()] ]
win = gui.Window("example", graf)
while True: # Event Loop event, values = win.Read() if event in (None, 'Exit'): break if event == 'function 1': runprog1("hello world 1") elif event == 'function 2': runprog2("hello world 2") elif event == 'function 3': runprog3("hello world 3") win.Close() ... https://www.youtube.com/watch?v=u4OM7-gvfco
35643328 Bytes