Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os,sys,io
- import pexpect
- import thread
- def read_output(proc):
- while True:
- print proc.readline()[:-1]
- shell = pexpect.spawn("sh", timeout=None, echo=False)
- thread.start_new_thread(read_output, (shell,))
- while True:
- shell.expect("$")
- shell.sendline(raw_input())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement