如何单击一个按钮运行两个命令?例子:def commend1(): print "hi"def commend2(): print "hello"#TKinterbutton = Button(root, commend= ?)我希望它们同时运行
2 回答

至尊宝的传说
TA贡献1789条经验 获得超10个赞
最基本的答案是:
def commend1():
print "hi"
def commend2():
print "hello"
def cmd12():
commend1()
commend2()
#TKinter
button = Button(root, command=cmd12)

萧十郎
TA贡献1815条经验 获得超13个赞
你可以让你的commended1() 像这样调用commend2():
def commend1():
print "hi"
commend2()
def commend2():
print "hello"
#TKinter
button = Button(root, command= commend1)
添加回答
举报
0/150
提交
取消