Created
May 14, 2020 06:08
-
-
Save K41R1/4c4accdd51857cb4a3fc14249cfdfc06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
def checkIfMidnight(): | |
now = datetime.now() | |
seconds_since_midnight = (now - now.replace(hour=0, minute=0, second=0, microsecond=0)).total_seconds() | |
return seconds_since_midnight == 0 | |
def main(): | |
print("hello world") | |
if __name__ == '__main__': | |
while True: | |
if checkIfMidnight(): | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment