擅长:python、mysql、java
<p>您可以创建一个以小时和分钟为参数的函数,并在<code>while</code>循环中执行检查:</p>
<pre><code>import datetime
def proc(h, m):
while True:
currentHour = datetime.datetime.now().hour
currentMinute = datetime.datetime.now().minute
if currentHour == h and currentMinute == m:
break
# Do stuff...
# Function call.
proc(18,0)
</code></pre>