擅长:python、mysql、java
<p>这里有一个方法。你知道吗</p>
<pre><code>import datetime
# Get date time and convert to a string
time_now = datetime.datetime.now().strftime("%S")
mins = int(time_now)
# run the if statement
if mins > 10 and mins < 50:
print(mins, 'In Range')
else:
print(mins, 'Out of Range')
</code></pre>