Printing the current minute in a loop with python
<p>I'm using python 3 and trying to create a script that runs constantly, and at some time, execute a specific code.
The code i have so far, verifies the current minute, and if it's above a given minute, it print's a message, otherwise, it prints the current minute and waits 5 seconds and try again.
The problem is that it only prints the minute the code started.</p>

<pre><code>import time
from datetime import datetime
now = datetime.now()
hour = now.hour
minute = now.minute
L=1

while (L == 1):
    if minute &gt; 39:
        print ("It's past "+str(hour)+":"+str(minute))
        L = 2
    else:
        print(str(minute))
        time.sleep(5)
</code></pre>

<p>you have to insert the assigments</p>

<pre><code>now = datetime.now()
hour = now.hour
minute = now.minute
</code></pre>

<p>inside the while loop, or they'll not be refreshed</p>

python