我需要从Python调用ImageMagick convert
工具。如果我没有使用Python并且只是在Windows shell中运行这样的命令:
C:\> convert "C:/Apache24/htdocs/layers/4_projected.tif" "C:/Apache24/htdocs/layers/3_projected.tif" "C:/Apache24/htdocs/layers/2_projected.tif" -combine "C:/Apache/htdocs/layers/432.tif"
效果很好。但是,当我尝试从Python运行它时:
>>> import subprocess
>>> subprocess.call(["convert", "C:/Apache24/htdocs/layers/4_projected.tif", "C:/Apache24/htdocs/layers/3_projected.tif", "C:/Apache24/htdocs/layers/2_projected.tif", "-combine", "C:/Apache24/htdocs/layers/432.tif"])
我收到一条错误消息,上面写着:
不允许使用参数:C:/ Apache24
我还尝试了//
,\
和\\
斜杠,但得到了同样的错误。那么,那可能有什么问题?