I need to call a subprocess with quotations (imagemagick, I now there is PythonMagick but I want to use subprocess)
Call on command line is:
convert logo: -fill white -draw "rectangle 50,50 400,400" abc.png
which works perfectly. Remark: The quotations have to be set.
Calling this on python could look like:
Code: Alles auswählen
import subprocess
params = ['convert', 'logo:', '-fill', '-draw', '"rectangle 50,50 400,400"', 'abc.png']
subprocess.check_call(params)
I tried several combinations like:
Code: Alles auswählen
params = ['convert', 'logo:', '-fill', '-draw', '"rectangle', '50,50', '400,400"', 'abc.png']
params = ['convert', 'logo:', '-fill', '-draw', '\"rectangle', '50,50', '400,400\"', 'abc.png']
How can I get the quotations into calling the subprocess?