This is... I can't update the time.ㅠ<python
now=datetime.now() is outside the while statement, so there seems to be a problem.
I'm not sure what exception the try-exception phrase was used for, but I don't think there will be any problem if you write the code like this.
Of course, it will be updated once every 3 seconds, and the time will be checked for minutes, so if it is renewed 20 times, data number 1 will change.
First, datetime.now() is to store the time at which the function is executed, so the first run time outside of the while statement is recorded.
It can be used as below.
Therefore, the reference object of the now variable must be updated within the while statement to change the time.
Another issue is try-exception, but I don't think there will be any exceptions from the code I wrote.
Therefore, you should study the try-exception or think of another way to do whatever you want.
© 2022 pinfo. All rights reserved.