Can a Python script enter commands on the command line -
i have executable script, let's call script.py. trying run series of commands within terminal starting
python3 ./differentscript.py console
which allow me type in additional commands.
however, wondering if can automated i.e. have script somehow output , execute commands?
edit: took @ links commented below; can provide example of like?
@chen xie
if want call few commands @ once, can call below:
subprocess.popen('echo first&echo second&echo third', stdout=subprocess.pipe, shell=true).stdout.read()
it's not pythonic solution, works.
wiki
Comments
Post a Comment