0

I would like to control multiple cameras. I have tried with:

gphoto2 (--camera: Nikon\ DSC\ 5300 --capture-image

but with terminal of linux and it works. The problem comes when I want to write in a script in python. I always get an error

-105: unknown model)

in python. But I can see my cameras and the port where they are. I think the problem is how to write the name of model in python. someone could you help me? I have tried:

from sh import gphoto2 as gp
 
gp('--camera: Nikon\ DSC\ 5300 --capture-image')
10 Rep
  • 2,217
  • 7
  • 19
  • 33
  • The backslash is a special character that _escapes_ the next character. To include a literal backslash in a python string, you need to either use a raw string `gp(r'--camera: Nikon\ DSC\ 5300 --capture-image')` or escape the backslash with another backslash `gp('--camera: Nikon\\ DSC\\ 5300 --capture-image')`. You might not need any escapes though, because the escaped spaces are needed so that the _terminal_ doesn't think the space signifies the start of a new argument: try `gp('--camera: Nikon DSC 5300 --capture-image')` – Pranav Hosangadi Jun 18 '21 at 18:53
  • Thanks for your comments it was very helpful.I could solve my problem. The issue was the sintaxis in python, well, I am novice both, python and stack overflow. It is how I solved: gp ("--camera","Nikon DSC D530","--capture-image"). Again, thanks @Pranav Hosangadi – jirivchi Jun 19 '21 at 09:52

0 Answers0