<jupyter_start><jupyter_text>Alarm ClockA simple clock where it plays a sound after X number of minutes/seconds or at a particular time.<jupyter_code>import time
import os
alarm_choice = input("Do you want to set the alarm at a particular (t)ime " + 
                     "or after some time (p)eriod?\nPlease enter 't' or 'p': ")

if alarm_choice == "t":      
    while True:    
        alarm_time = input("Please enter the alarm time(h:m): ")
        current_hour      = int(time.ctime().split(" ")[3].split(":")[0])
        current_minute    = int(time.ctime().split(" ")[3].split(":")[1])
        alarm_time_hour   = int(alarm_time.split(":")[0])
        alarm_time_minute = int(alarm_time.split(":")[1])
        if current_hour * 60 + current_minute < alarm_time_hour * 60 + alarm_time_minute:
            time.sleep((alarm_time_hour - current_hour) * 3600 + (alarm_time_minute - current_minute) *60)
            os.startfile("C:/Users/MK/default.mp3")
            break
        else:            
            print("That time has already come!")
            continue

if alarm_choice == "p":      
    while True:    
        alarm_period = input("Please enter the time duration before the alarm (h:m): ")          
        alarm_period_hour     = int(alarm_period.split(":")[0])
        alarm_period_minute   = int(alarm_period.split(":")[1])         
        time.sleep(alarm_period_hour * 3600 + alarm_period_minute *60)
        os.startfile("C:/Users/MK/default.mp3")
        break   
os.startfile("C:/Users/MK/default.mp3")
alarm_time = "2:23"
int(alarm_time.split(":")[1])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1368421052631579, 'fraction_numerical': 0.019195046439628483, 'mean_word_length': 2.6561085972850678, 'pattern_counts': {'":': 9, '<': 6, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '622086', 'license': 'MIT', 'n_tokens_mistral': 549, 'n_tokens_neox': 532, 'n_words': 115, 'path': 'mk011-project_alarm_clock.ipynb', 'repo_name': 'karakose77/complete-python-bootcamp-exercises-and-projects', 'size': '1615'}