Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- quietStart = 23
- quietEnd = 9
- def nightCheck():
- currentHour = int(time.strftime('%H'))
- if quietEnd > quietStart:
- if quietStart > currentHour and quietEnd < currentHour:
- return(True)
- else:
- return(False)
- elif quietEnd < quietStart:
- if quietStart >= currentHour and quietEnd > currentHour:
- return(True)
- else:
- return(False)
- nightMode = nightCheck()
- print(nightMode)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement