how can I call a dos command in pycharm?

已回答

Python 3.36 / pycharm community version 5.04

I am using non-installed Ghostscript version.  I am on a network and have to run it this way because I cannot install anything to the boot drive.  Ghostscript does work, and has been tested using the cmd console.

I need to get to the path that has ghostscript > bin folder.  I need to invoke this line from a path m:\ghostscript\bin 

gswin64c -sDEVICE=pdfwrite -sOutputFile=out.pdf input.ps

How can I do this in pycharm?  I am guessing 

    import os

    import sys

Any suggestions after this?

 

0

Hi David! I believe there're different ways to do it in Python, did you try os.system or subprocesshttps://stackoverflow.com/a/3731000/2787185

0
Avatar
Permanently deleted user

I haven't tried anything yet.  I am new to this.  I don't even know if this will work.

0

请先登录再写评论。