Nov-19-2018, 08:54 PM
In the code snippet below, the subprocess.call command generates the file not found error shown below. However, passing the same variable "command" to os.system works. I've read that subprocess is preferroed over os.system, so I'd like to get that working.
-Thanks
-Thanks
for file in jpgfiles: jpgfile = '"' + jpgdir + file + '"' command = "convert " + str(jpgfile) + " -font Helvetica -pointsize 60 -fill lightblue -quality 100 -gravity southeast -auto-orient -annota # Generates file not found error shown below # subprocess.call([command]) # WORKS os.system(command)
Error:FileNotFoundError: [Errno 2] No such file or directory: 'convert "/home/bfbarton/CentOS Share/pics/Trenton Makes Bridge-10062018.jpg" -font Helvetica -pointsize 60 -fill lightblue -quality 100 -gravity southeast -auto-orient -annotate +80+50 %[exif:DateTimeOriginal] "/home/bfbarton/CentOS Share/pics/Trenton Makes Bridge-10062018.jpg"': 'convert "/home/bfbarton/CentOS Share/pics/Trenton Makes Bridge-10062018.jpg" -font Helvetica -pointsize 60 -fill lightblue -quality 100 -gravity southeast -auto-orient -annotate +80+50 %[exif:DateTimeOriginal] "/home/bfbarton/CentOS Share/pics/Trenton Makes Bridge-10062018.jpg"'