import os import time

username = "your_username"

start_time = time.time()

while True: if time.time() - start_time >= 46060: # 判断是否超过四个小时 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

请示例代码用python完成以下需求:while循环判断是否四个小时之后如果没有则循环运行osstartfilerCUserssDesktopplaylistMP3_DaXueJiangZhimp3 username timesleep230 osstartfilerCUserssDesktopplaylistWAV_TuRanHenXiangNiwav username timesleep2

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

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