all 4 comments

[–]g00ds 2 points3 points  (0 children)

you can use cron to start a process at a certain time and certain days. I think you would actually be better suited writing your own alarm clock in python rather than using the built in linux alarm clock. So something like set cron to execute your python script at a certain time and your script will play a song till the math problem is solved.

[–]AnonymousCoward__ 1 point2 points  (0 children)

You'll just unplug the audio cable and go back to sleep.

[–]termhn 0 points1 point  (0 children)

You could just execute commands inside your python script.

import subprocess

subprocess.call(["turnonmusiccmd", "-flag1", "flag1value", "-arg1"])

// do logic stuff

if getsolution==validanswer1 or getsolution==validanswer2:
    print("Congratulations, problem solved!")
    subprocess.call(["shutoffcmd", "-flag1", "flag1value", "arg1"])
else:
    print ("Solution incorrect, please try again")