def speak_time(): Utility.Sleep(100) rand = Utility.getRandom(0,1) hour = Utility.getHour() min = Utility.getMinute() if (rand == 0): SoundPlay("the time is") Utility.Sleep(100) else: SoundPlay("it is currently") Utility.Sleep(100) if (hour < 11): if (hour < 10): hour = hour[1:] NumberPlay(str(hour)) speak_minute(min) SoundPlay("AM") elif (hour == 12): NumberPlay(str(hour)) speak_minute(min) SoundPlay("PM") elif (hour > 12 & hour <= 23): b = 12 newHour = hour - b NumberPlay(str(newHour)) speak_minute(min) SoundPlay("PM")
def test(): Utility.Sleep(100) h = Utility.getHour() print("Hour is: ") print(h) m = Utility.getMinute() print("Minute is: ") print(m) Media.speak_time() rand1 = Utility.getRandom(0,1) print(rand1) rand2 = Utility.getRandom(0,10) print(rand2) Media.what_can_i_do()