bash - Open shell in Python -


this question has answer here:

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

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -