commands in Tkinter

后端 未结 3 805
死守一世寂寞
死守一世寂寞 2021-01-15 11:07

I have the following code by it isn\'t working any ideas?

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-15 11:45

    This parameter will not accept two functions. The best way for you to solve this is to create a function that performs all other functions.

    def main_menu():
        pass
    
    
    def apending_to_text_file():
        pass
    
    
    def commands():
        main_menu()
        apending_to_text_file()
    
    
    login_button = Button(
        root, text="Click here to enter data",
        command=commands
    )
    

提交回复
热议问题