0

I need to execute and send command to external app from python:

.\Ext\PrintfPC /p “C:\Leica\DBX” /l “.\joblist.log”

It is cmd app, Is it possible to hide its console and terminate after all also using only python?

1 Answer 1

1

You are probably looking for the subprocess module. Example for executing the ls -l bash command on a unix system:

subprocess.call(['ls', '-l'])

So, in your case it should probably look something like:

subprocess.call(['.\Ext\PrintfPC', '/p', 'C:\Leica\DBX', '/l', '.\joblist.log'])

Have a look at the linked documentation though, because you can also get the output back from the command line execution by using pipes / Popen objects.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.