So I found pexpect, it is a python version of expect, which does that.
For example to use with reset the database in django:
#call the commands
result = pexpect.spawn("python manage.py reset_db")
#tell it to expect what should shows
result.expect("Type 'yes' to continue, or 'no' to cancel")
#send the results
Actually you can use it to run programs. Without the expect methods or sendline. The program will just runs
import pexpect#just run the command
commands = pexpect.spawn("ls -a")
BTW, do check expect, it is the one that runs without python. Which is what pexpect based on. Either way, it should be available to any linux distro. On ubuntu find expect and pexpect on synation, it is there.