Dec-15-2022, 10:48 PM
(This post was last modified: Dec-15-2022, 10:48 PM by Larz60+.
Edit Reason: Cosmetic edit
)
what DeanStad is telling you is that lines 5 and 8 are referencing the Package name and not the instance.
for example, line 5 should read
same for line 8
A better way, and the one recommended by the author would be:
see: https://picamera.readthedocs.io/en/relea...i_exc.html
for example, line 5 should read
except PiCamera.PiCameraError:
same for line 8
A better way, and the one recommended by the author would be:
import picamera with picamera.PiCamera() as camera: try: camera.brightness = int(some_user_value) except PiCameraError: print('Something went wrong with the camera') # etc.assign exceptions to the individual actions, don't try to capture all in one place.
see: https://picamera.readthedocs.io/en/relea...i_exc.html