from ilogue.fexpect import expect, expecting, run
prompts = []
prompts += expect('What is your name?', 'John')
prompts += expect('Are you at stackoverflow?', 'Yes')
with expecting(prompts):
    run('my_command')
How to answer to prompts automatically with python fabric?