私はラズベリーのパイ3(os:rasbian)を持っています。私は13:00にこのコードを実行します。 私は12時に家にいますが、プログラムは1時間後に開始します。 。 どのようにプログラムを修正できますか? おかげpythonプログラムの開始時刻
import time
import picamera
with picamera.PiCamera() as camera:
camera.start_preview()
try:
for i, filename in enumerate(camera.capture_continuous('/home/pi/Google Drive/{timestamp:%H-%M-%S}-{counter:03d}.jpg')):
print(filename)
time.sleep(3)
if i == 3:
break
finally:
camera.stop_preview()
pythonプログラム内のプログラム開始にsleepコマンドを追加してみてください。 http://stackoverflow.com/questions/510348/how-can-i-make-a-time-delay-in-python – hmrc87
また、「sleep 3600 && python ...」をbashで実行するとコード自体を変更します。 –
@ the-run Pythonコードの書式を変更する際には十分注意してください。編集により構文エラーが発生しました。 – glibdud