擅长:python、mysql、java
<p>创建一个新函数,该函数同时调用:</p>
<pre><code>def o_and_t():
o()
t()
button = Button(admin, text='Press', command=o_and_t)
</code></pre>
<p>或者,您可以使用这个有趣的小功能:</p>
<pre><code>def sequence(*functions):
def func(*args, **kwargs):
return_value = None
for function in functions:
return_value = function(*args, **kwargs)
return return_value
return func
</code></pre>
<p>然后你可以这样使用它:</p>
<pre><code>button = Button(admin, text='Press', command=sequence(o, t))
</code></pre>