Very sorry to post such a basic question,
I have been reading and trying so many things
with no luck.
Platform is rasberry PI 4 running astroberry OS build.
Python version 2.7.16
The camera did not respond, returncode=0.
Question here is, I need an if statement that will
interrupt the code if return is 0, how do I use the
returncode, or parse check_camera is it 0 or 1.
Thank You
I have been reading and trying so many things
with no luck.
Platform is rasberry PI 4 running astroberry OS build.
Python version 2.7.16
The camera did not respond, returncode=0.
Question here is, I need an if statement that will
interrupt the code if return is 0, how do I use the
returncode, or parse check_camera is it 0 or 1.
Thank You
# Controll my Nikon D90 with GPIO #2
import logging
import RPi.GPIO as GPIO
import time
import os
import subprocess
import sh
import sys
from sh import gphoto2 as gp
#run a test to confirm camera is communicating
check_camera = subprocess.run(["gphoto2", "--auto-detect"]),
time.sleep(.5)
#print("stdout:", result.stdout)
#print("stderr:", result.stderr)
print (check_camera)
(CompletedProcess(args=['gphoto2','--auto-detect'] returncode=0),)
buran write Mar-29-2021, 04:28 PM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
