everything works fine while I do it via terminal but when I use python script it doesn't.
Command:
gphoto2 --capture-image-and-download --filename test2.jpg
New file is in location /capt0000.jpg on the camera
Saving file as test2.jpg
Deleting file /capt0000.jpg on the camera
I'ts all good. But when I try to do it via python script and subprocess nothing happens. I tried to do it like:
import subprocess
text1 = '--capture-image-and-download"'
text2 = '--filename "test2.jpg"'
print(text1 +" "+ text2)
test = subprocess.Popen(["gphoto2", text1, text2], stdout=subprocess.PIPE)
output = test.communicate()[0]
print(output)
and:
import subprocess
test = subprocess.Popen(["gphoto2", "--capture-image-and-download --filename'test2.jpg'"], stdout=subprocess.PIPE)
output = test.communicate()[0]
print(output)
While I use only --capture-image-and-download
it works fine, but I get filename that I don't want to. Can you tell me what I do wrong?!