how to turn on and off DND?

import time
from datetime import datetime
from plyer import notification



print("_Main_menu_")
print("1. set alarm")
print("2. set timer") #Haven't added yet plz ignore


while True:
    MenuChoice = input("select an option: ")
    try: 
        MenuChoice = int(MenuChoice)
    except ValueError:
        print("Invalid Option")
    else:
        MenuChoice = int(MenuChoice)
        if MenuChoice == 1 or MenuChoice == 2:
            break
        else: print("Invalid Option")


Time = datetime.now().time()
Time = str(Time)
print(Time[:-10])


if MenuChoice == 1:
    while True:
        Alarm = input("Set Time(HH:MM): ")
        try:
            Hour, Min = Alarm.split(":", 1)


            Min = int(Min)
            Hour = int(Hour)
            Valid = False
            Valid1 = False



            if Min > 59:
                print("Min can't be greater than 59")
            elif Min < 0:
                print("Min can't be less than 0")
            else: Valid = True


            if Hour > 23:
                print("Hour can't be greater than 23")
            elif Hour < 0:
                print("Hour can't be less than 0")
            else: Valid1 = True


            if Valid == True and Valid1 == True:
                print("Lock in until",Alarm)


            #turn on DND


                
                while True:
                    TimeNow = datetime.now().time()        #Loops until Alarm = TimeNow
                    TimeNow = str(TimeNow)[:-10]
                    time.sleep(.5)
                    if TimeNow == Alarm:
                        break


                #Turn off DND


                notification.notify(
                title="Time to take a break",
                message=f"it's {Alarm}, time to take a break",
                timeout=5 
                )


                break
        except ValueError:
            print("Invalid")

Above is my focus alarm I'm working on, could someone help with adding DND?

reddit.com
u/Sea-Personality-666 — 13 days ago

Any suggestions to improve my videos?

I’ve been on YouTube for a few months now and would love some feedback!

I’m @RandomPerson_128

u/Sea-Personality-666 — 16 days ago
▲ 14 r/Soap+1 crossposts

Soap moulds

Hi guys. Just joined the community. My mom makes soap and I really wanna help market it and get clients etc. but she’s using such a shit mould(basically metal stencil for like 2 soaps no design etc, like a gate) I told here if she gets proper moulds it’ll be so much easier to market the product . Any advise would appreciated. Also need to work on here packaging. For reference, this is what we have so far. The soups in a tub are actually just the bar soaps put in there . I was thinking it’s a waste, she could get atleast a couple bars out of that

u/Etherealnutt — 7 days ago

I'm trying to make a paragraph generator

It doesn't need to make understandable text it just needs to be grammatically correct, any ideas to make it better

import random
import time
import sys


C_length = 0
space_counter = 0


letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']


weights = [8.2, 1.5, 2.8, 4.3, 12.7, 2.2, 2.0, 6.1, 7.0, 0.16, 0.77, 4.0, 2.4, 6.7, 7.5, 1.9, 0.12, 6.0, 6.3, 9.1, 2.8, 0.98, 2.4, 0.15, 2.0, 0.074]
#source https://en.wikipedia.org/wiki/Letter_frequency


sentence = []



length = int(input("Enter the length of the sentence: "))


start = time.perf_counter()



for i in range(length):
    sentence.append(random.choices(letters, weights=weights)[0])
    
    space = random.randint(1, 5)
    if space == 1:
        sentence.append(" ")
        space_counter += 1


    C_length += 1
    print(f"\rCurrent length: {C_length} of {length}", end="")


end = time.perf_counter()


print(" ")
print("Final sentence: ")
print(" ")
print("".join(sentence))
print(" ")
print(f"Time elapsed: {end - start:.2f} seconds")
reddit.com
u/Sea-Personality-666 — 1 month ago
▲ 34 r/MildlyMiku+1 crossposts

My favorite dish soap combination 🦋

Seventh Gen - Clementine Zest and Lemongrass scent with a splash of classic blue dawn

u/Sea-Personality-666 — 7 days ago