I have a python script that calls a shell script. The shell script captures an image, names the image using a timestamp, and then saves the image to directory. When the shell script finishes, I would like to access the image from the python script that called the shell script.
Here is my shell script capture.sh
:
DATE=$(date +"%Y-%m-%d_%H%M%S")
fswebcam -r 1280x720 --no-banner /home/pi/app/images/$DATE.jpg
exit 0
This shell script is called from capture.py
:
import os
import subprocess
# call script
subprocess.call(['/home/pi/app/capture.sh'])
#?how to retrieve and process image: /home/pi/app/images/$DATE.jpg
Any advice would be welcome! Thank you!