Python定时播放音乐并自动关闭Groove播放器
import os import time
username = 'your_username'
start_time = time.time()
while True: if time.time() - start_time >= 4 * 60 * 60: # 判断是否超过四个小时 os.system('TASKKILL /F /IM groove.exe') # 关闭groove播放器 break os.startfile(r'C:\Users%s\Desktop\playlist\MP3_DaXueJiangZhi.mp3' % username) time.sleep(230) os.startfile(r'C:\Users%s\Desktop\playlist\WAV_TuRanHenXiangNi.wav' % username) time.sleep(29) os.startfile(r'C:\Users%s\Desktop\playlist\WMA_YiQianGeShangXinDeLiYou.wma' % username) time.sleep(275)
原文地址: https://www.cveoy.top/t/topic/osJi 著作权归作者所有。请勿转载和采集!