最近新學了python,結合網上大神的代碼,撰寫了一個鬧鐘小程式,這是我現在最大的需求,用自己制作的東西叫自己起床搬磚

然而,當我自學了subprocess模塊后,覺得搞懂了語法和引數,運行后,輸入鬧鐘響起時間點,到點兒了就要見證奇跡了,,,可是它彈出了視窗,卻沒有音樂響起來,我又找了好久原因,,嘗試了各種可能性,依然不響。。。
我的解決問題的能力尺度可能就到這里了,想請各位看到我帖子的大神拔刀相助,不勝感激

附上代碼和運行視窗

import sys
import time
import subprocess
set_time = input("請您設定鬧鐘時間(例如:8:00):")
print("當前的時間為:")
def clock():
start = True
while start:
local_time = time.localtime()
now = time.strftime("%H:%M:%S", local_time)
print(now + "\r", end="", flush=True)
if now[:5] == set_time.rjust(5, "0"):
print("起床時間到了!!!!!!")
subprocess.Popen(["start","C:\\Users\\Administrator\\Desktop\\test\范瑋琪 - 最初的夢想.mp3"],shell=True)
start = False
clock()
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/133176.html
標籤:其他技術專區
