2
[email protected]:~#convert source.jpg -resize x500 -resize "500x<" -gravity center +repage target.jpg
Python代碼:
>> command_list = ['convert', 'source.jpg', '-resize', 'x500', '-resize', '\'500x<\'', '-gravity', 'center', 'target.jpg']
>> p = subprocess.call(command_list)
convert: invalid argument for option `'500x<'': -resize.
什麼是錯在上面的代碼?
更準確,論據並不需要在一般的引用 - 只有當你傳遞一個命令行外殼或系統() – 2009-11-28 05:45:49