bash - Open shell in Python -
this question has answer here:
- calling external command in python 44 answers
how can open in python unix shell, type command , other inputs , close unix shell?
example commands , inputs:
telnet 127.0.0.1:6000 user pass save-all restart
greets
miny
you can have @ pexpect
module , more precisely interact function.
see documentation here.
basically, juste spawn sheel, program or whatever want, , interact do.
import pexepect p = pexpect.spawn('/bin/bash') p.interact()
then escape escape character explained in doc.
Comments
Post a Comment