0

I have an application, which allows both by GUI and CLI. Is there any option to make use of this CLI commands using python, so that i can automate the set of process for that application(i.e. replace the set of work with single click)

asked Aug 1, 2018 at 13:42
2
  • 2
    "Is there any option....?" The answer is probably "yes", but the question is vague. What is the problem exactly? Commented Aug 1, 2018 at 13:48
  • instead of opening an application and doing some brainless work, what is the option (Eg: which python library / how to write a python script) , so that by double clicking on .exe file it should do all those process in the background. Commented Aug 1, 2018 at 13:59

1 Answer 1

1

Use subprocess

from subprocess import check_output
# check_output returns the output of the command
# note: date is a unix command, try something else if on windows
result = check_output('date', encoding='utf8')
print(result)
answered Aug 1, 2018 at 13:48
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.