Home > other >  The small alarm clock to the time point of the Python doesn't ring, this let me how to get out
The small alarm clock to the time point of the Python doesn't ring, this let me how to get out

Time:10-26

Recently new python, combined with the great spirit of the code on the net, wrote a small alarm clock procedures, this is I now the biggest demand, with their own things called up his move brick

When I taught myself the subprocess module, however, think that understand the syntax and parameters, and after the operation, enter the alarm clock rang point in time, to something is about to witness the miracle,,, but it pop up the window, but there was no music sounded, and I find the reason, for a long time, tried all sorts of possibilities, still not ring,,,

I the ability to solve the problem of scale may be here now, want to see my post great god please draw out a sword, appreciate

Attached code and run window


 

The import sys
The import time
The import subprocess

Set_time=input (" please you set the alarm clock time (for example: 8:00) : ")
Print (" the current time is: ")


Def clock () :
Start=True
While the start:
Local_time=time. Localtime ()
Now=time. Strftime (" M H % : % : % S ", local_time)
Print (now + "" r ", "end=" ", flush=True)

If now [5]==set_time. Rjust (5, "0") :
Print (" time to get up!!!!!!!!!!!!!!!
")Subprocess. Popen (" start ", "C: \ \ Users \ \ Administrator \ \ Desktop \ \ test \ Christine fan - the initial dream. Mp3"], shell=True)
Start=False
Clock ()
  • Related