I'm having the problem that when running this program, no matter what, everything you input are counted as seconds rather than wahtever unit you actually chose.
__author__ = 'Exanimem'
# Homework Notifier Version 0.1.5 It works a bit better. Kind of.
import time
import threading
import webbrowser
import winsound
import ctypes
import sys
import math
import pyglet
# TO-DO
# NOTE: NOT LISTED IN ORDER OF PRIORITY
# Add months, years, decades, and centuries including system to detect what month, year, decade, and centry it is
# Add ability to remind at a specific time in a unit, like "4:50 in 1 day"
# Detect spelt out numbers as numbers
# Have that you press enter then answer
# Have message box be brought to front of the screen
# Have notifications still come when application closed
# Combine unit and digit function
# User Friendly UI?
# Allow users to input time like "4:30 PM EST"
# Autodetect timezone
# Recorded log to look back on past notifications?
# Configurable beep (with music)
# Restart function (Instead of stopping program at whatever point, have option to create new notification)
# Multiple notifications
# Test stop function further and improve
# Save notification's from last time opened
# KNOWN BUGS
# Everything counted as seconds
# Occasionally message box will not appear
HW = input("What homework should I remind you to do?")
# Enter your homework
remind = input("When would you like me to remind you of this?")
# Enter desired time
remind = float(remind)
unit = input("Will your unit be in seconds, minutes, hours, days, or weeks?")
# Enter correct unit
if unit == "seconds":
remind*1
if unit == "minutes":
remind * 60
if unit == "hours":
remind * 3600
if unit == "days":
remind * 86400
if unit == "weeks":
remind * 604800
continuous = input("Would you like to have the notification be continuous?")
print(
"You may now leave the application in the background. Closing the application and shutting down your computer will deactivate the notification you have planned.")
while continuous == "yes":
time.sleep(remind)
Freq = 2500 # Set Frequency To 2500 Hertz
Dur = 1000 # Set Duration To 1000 ms == 1 second
winsound.Beep(Freq, Dur)
print("The message box has opened, but as another reminder your homework is")
print(HW)
ctypes.windll.user32.MessageBoxW(0, HW, "Homework!!!", 1)
if input("To stop the loop and close the program, please type in 'stop'") == "stop":
break
if continuous == "no":
time.sleep(remind)
Freq = 2500 # Set Frequency To 2500 Hertz
Dur = 1000 # Set Duration To 1000 ms == 1 second
winsound.Beep(Freq, Dur)
print("The message box has opened, but as another reminder your homework is")
print(HW)
ctypes.windll.user32.MessageBoxW(0, HW, "Homework!!!", 1)
I first thought the problem was the indentation on the first if, but if it is intended at all, the program ceases to work. I've tried figuring this out for awhile but I can't for the life of me. Help?