Nov-19-2018, 09:24 PM
(Nov-19-2018, 09:02 PM)wavic Wrote: Line 4, 3 quotes.
You have to break the command by spaces.
command = "convert " + str(jpgfile) + " -font Helvetica -pointsize 60 -fill lightblue -quality 100 -gravity southeast -auto-orient -annota" command = command.split()
Now I'm getting the error below.
-Thanks
jpgdir = "/home/bernie/CentOS Share/pics/" jpgfiles = fnmatch.filter(os.listdir(jpgdir), '*.jpg') command = "convert " + str(jpgfile) + " -font Helvetica -pointsize 60 -fill lightblue -quality 100 -gravity southeast -auto-orient -annotate +80+50 %[exif:DateTimeOriginal] " + str(jpgfile) command = command.split() subprocess.call([command])
Error:Traceback (most recent call last):
File "./im-datestamp.py", line 36, in <module>
subprocess.call([command])
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/subprocess.py", line 267, in call
with Popen(*popenargs, **kwargs) as p:
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/subprocess.py", line 1258, in _execute_child
executable = os.fsencode(executable)
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/os.py", line 800, in fsencode
filename = fspath(filename) # Does type-checking of `filename`.
TypeError: expected str, bytes or os.PathLike object, not list