Hey, let's not mention that I've been lazy since I got home. I've always been disliked by others, and I still feel that there is no hope in life. Fortunately, I met some big guys in the community, which made me want to start over and be myself again.Joker, so I wanted to use something to remind me not to sleep in, and this article was born.
Alarm
poetry add playsoundpoetry add pyttsx3
If you are not familiar with playsound and pyttsx3, you can learn it. One is the audio playback module and the other is the text reading module. We will use it later.
First of all, let's set the scheduled time of the alarm clock:
alarm_time = input("Enter the alarm time to be set: HH:MM:SS\n")alarm_period=input("Please input the period to be set (AM or PM):\n")alarm_hour=alarm_time[0:2]#Get the houralarm_minute=alarm_time[3:5]#Get minutesalarm_seconds=alarm_time[6:8]#How many secondsalarm_period = alarm_period.upper()print("The setup is running successfully, I wish you a good rest....zzZZ..")
An alarm clock that can help you quit your job:
while flag:now = datetime.now()current_hour = now.strftime("%I")current_minute = now.strftime(&