how can I call a dos command in pycharm?
Answered
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?
Please sign in to leave a comment.
Hi David! I believe there're different ways to do it in Python, did you try os.system or subprocess? https://stackoverflow.com/a/3731000/2787185
I haven't tried anything yet. I am new to this. I don't even know if this will work.