Using a Windows path within Python's subprocess (point to an executable) [beginner]

浪尽此生 提交于 2019-12-04 17:33:11

The path contains a space here Program Files. Typically, a space means end of the path. Using quotes " around the path tells the operating system not to consider the space as the end of the path but to take all the text in between the quotes as the path. So just add quotes:

subprocess.check_output([r'"C:\Program Files\gs\gs9.20\bin\gswin64c.exe" -sDEVICE=jpeg -dPDFFitPage -g2800x3620 -o 2800-%03d.jpg test.pdf']) 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!