所以我有一个RetroPie设置,我试图找到一种方法,在关闭或重新启动时,我可以在其余代码关闭内容的同时播放视频。然后等待视频结束,然后立即关闭。
想法是让视频播放,而不是看到命令窗口和正在运行的代码
import os
#Start Playing video here
#Need code so this plays while other code below runs
os.system('pkill omxplayer')
os.system('omxplayer -r /home/pi/RetroPie/shutdown/shutdown.mp4')
#Shutting down ES and wait for any data to finish writing to drives.
os.system('sudo killall emulationstation')
os.sync()
#Wait for video to finish
#Need waiting code for video to finish
os.system('shutdown -h now')