Skip to content
Permalink
Browse files
Update times.py
Comments added
  • Loading branch information
mirikip committed Nov 28, 2018
1 parent efdc833 commit bbd94fa98984ad4137711b3dac8a73b9db3a7e3a
Showing 1 changed file with 12 additions and 2 deletions.
@@ -1,26 +1,36 @@
#import modules
import time
import webbrowser
import calendar

def calendar_reminder(what):
if "calendar" in what:
#Python Calendar to display given months in a year or whole year
#Allows user to select what they want the calendar to do
yom = input("Would you like the whole year or one month?").lower()
if "month" in yom:
print("Please enter as numbers ")
year = int(input("What year will you like? "))
month = int(input("What month would you like? "))
#display the calendar
print(calendar.month(year, month))
if "year" in yom:
year = int(input("What year will you like? "))
#Display the calendar
print(calendar.calendar(year))
if "reminder" in what:
#Wakeup alarm type function
#takes a given time input and compares it to the current time
#if the two times are equal it opens a youtube lin k and starts to play an alarm video
#and displays wakeup in the python terminal
wakeup = input("What time do you want to wake up? \n Write in the form 'hh:mm' : ")
#converts datetime to a string
Time = time.strftime("%H:%M")
while Time != wakeup:
Time = time.strftime("%H:%M")
if Time == wakeup:
print(
"__ __ _ _ _ _ \n\ \ / /_ _| | _____ | | | |_ __ | | \n \ \ /\ / / _` | |/ / _ \ | | | | '_ \ | |\n \ V V / (_| | < __/ | |_| | |_) | |_|\n \_/\_/ \__,_|_|\_\___| \___/| .__/ (_)\n |_|")
print("__ __ _ _ _ _ \n\ \ / /_ _| | _____ | | | |_ __ | | \n \ \ /\ / / _` | |/ / _ \ | | | | '_ \ | |\n \ V V / (_| | < __/ | |_| | |_) | |_|\n \_/\_/ \__,_|_|\_\___| \___/| .__/ (_)\n |_|")
#webrowser opens the youtube link given to it and the alarm begins to play
webbrowser.open("https://www.youtube.com/watch?v=lZ4n46lEWgU")
else:
print("")

0 comments on commit bbd94fa

Please sign in to comment.