我遇到以下脚本的问题。在进入 def PlayAndWait(mediafile)之前,一切正常。我查看了所有代码,但直到最近才使用while True语句。
import xbmc
import time
import os
import time
import glob
import random
xbmc.executebuiltin("SlideShow(/home/pi/pictures)" )
while True:
time.sleep(60-time.time()%60)
xbmc.executebuiltin("Notification(Every Minute,Notification!)")
while True:
time.sleep(360-time.time()%360)
xbmc.executebuiltin("Notification(Every Five Minutes,Notification!)")
def PlayAndWait(mediafile):
xbmc.executebuiltin("PlayMedia(%s)" % mediafile, True)
while xbmc.Player().isPlaying():
time.sleep(1.0)
files = glob.glob('/home/pi/videos/*.mov')
if not files:
filename = random.choice(files)
if os.path.isfile(filename):
PlayAndWait(filename)
xbmc.executebuiltin("SlideShow(/home/pi/pictures)")