Advertisement
Guest User

Untitled

a guest
May 28th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. import os,sys,io
  2. import pexpect
  3. import thread
  4.  
  5. def read_output(proc):
  6. while True:
  7. print proc.readline()[:-1]
  8.  
  9. shell = pexpect.spawn("sh", timeout=None, echo=False)
  10. thread.start_new_thread(read_output, (shell,))
  11.  
  12. while True:
  13. shell.expect("$")
  14. shell.sendline(raw_input())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement