import os import time

start_time = time.time() while True: username = os.getlogin() current_time = time.time() if (current_time - start_time) >= 46060: # 超过4小时,停止循环并关闭groove播放器 os.system('taskkill /f /im Music.UI.exe') break else: # 播放音乐 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)

Python 循环播放音乐并自动关闭 Groove 播放器

原文地址: https://www.cveoy.top/t/topic/osJk 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录