Python Fabric: How to handle arbitrary remote shell prompt for input?
I have proposed an API for this feature in fabric on the mailinglist,and ended up writing something myself:
from fexpect import expect, expecting, run prompts = []prompts += expect('What is your name?','John')prompts += expect('Where do you live?','New York')with expecting(prompts): run('command')
See my blogpost on expecting prompts in fabric with fexpect