Reputation: 27
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)
Upvotes: 0
Views: 53
Reputation: 887
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)
Upvotes: 1