For example, if one time is before or after another, the computer can know if an event is in the past or if the reminder time is after the event time. Write the function time1_less_than_eq_time2 with the purpose of checking if one time is before another so the program can compare times. The function should return the converted date. This function will take the string date_with_dashes and will change it from YYYY-MM-DD to MM/DD/YYYY. Write a function called convert_date_string_format with the parameter date_with_dashes. In the program, for comparisons, the times will be compared by the event hour (before the colon) and the event minute (after the colon). When you see your reminder, it will show the event time in military time. Current time describes the precise current time, the event time is when the event takes place, and the reminder time is when to execute the reminder. We have three times of interest associated with our program flow. In addition to the previously installed libraries, datetime (which is already installed into Python by default) is used to access the current date and time during execution. Import the datetime, keyboard, pyttsx3, and time libraries. Name code in a way you can remember (ex: scheduleBot.py) but make sure it ends in. Open a text editor on Raspberry Pi to begin writing code.
0 Comments
Leave a Reply. |