更新时间:2022-04-28 08:52:29
你希望你的代码更像这样:
You want your code to be more like this:
from subprocess import call
while True:
try:
call(["raspivid -n -b 2666666.67 -t 5000 -o test.mp4"], shell=True)
call(["raspivid -n -b 2666666.67 -t 5000 -o test1.mp4"], shell=True)
except KeyboardInterrupt:
break # The answer was in the question!
您break
一个完全符合您预期的循环.
You break
a loop exactly how you would expect.