How to run two commands on click on one button ?
Example:
def commend1():
print "hi"
def commend2():
print "hello"
#TKinter
button = Button(root, commend= ?)
I want them to run at the same time
How to run two commands on click on one button ?
def commend1():
print "hi"
def commend2():
print "hello"
#TKinter
button = Button(root, commend= ?)
I want them to run at the same time
The most basic answer for that would be:
def commend1():
print "hi"
def commend2():
print "hello"
def cmd12():
commend1()
commend2()
#TKinter
button = Button(root, command=cmd12)
You can have your commend1() to call commend2() like this :
def commend1():
print "hi"
commend2()
def commend2():
print "hello"
#TKinter
button = Button(root, command= commend1)