This works in my terminal:
find "/tmp/pic" \( -iname *.JPG \) | parallel -j 3 convert {} -resize 1920x -quality 60 "/tmp/pic2/{/}"
This doesn't work with python:
from subprocess import call
import shlex
call(shlex.split('find "/tmp/pic" \( -iname *.JPG \) | parallel -j 3 convert {} -resize 1920x -quality 60 "/tmp/pic2/{/}"'), shell=True)
I've found this question with the same error. But the suggested solution (shell=True
) doesn't work. The solution with os.walk
described of @abarnert sounds logical, but I just would like to understand what is wrong in my code.