2024-10-01 02:36:33 发布
网友
我尝试使用以下语法从Spyder IDE运行ImageMagickBashShell脚本textcleaner,但我无法使其正常工作。在
导入操作系统 操作系统(“textcleaner-g-e规格化-f 30-o 12-s 2英寸.png输出.png“)
Textcleaner是我的Imagemagick bash shell脚本。我没有尝试从Python运行它。但这应该可以使用python3子进程来实现。在
import subprocess cmd = 'textcleaner -g -e normalize -f 30 -o 12 -s 2 in.png out.png' subprocess.call(cmd, shell=True)
您可能需要在textcleaner之前使用bash和/或textcleaner的完整路径。此外,您可能需要提供输入和输出的完整路径。还要确保编辑脚本的权限以使其可执行(chmodu+xtextcleaner)。请参阅我在http://www.fmwconcepts.com/imagemagick/index.php上使用的指针
Textcleaner是我的Imagemagick bash shell脚本。我没有尝试从Python运行它。但这应该可以使用python3子进程来实现。在
您可能需要在textcleaner之前使用bash和/或textcleaner的完整路径。此外,您可能需要提供输入和输出的完整路径。还要确保编辑脚本的权限以使其可执行(chmodu+xtextcleaner)。请参阅我在http://www.fmwconcepts.com/imagemagick/index.php上使用的指针
相关问题 更多 >
编程相关推荐