Q:

How to use python to start an interactive shell program?

I have used python subprocess and os module for a while. Now I want to start an interactive C++ program called dumbCalculator from python. This dumbCalculator simply read my input and return its result: when I type 1+2 it returns 3
How can I use my python script to call this dumbCalculator binary? apparently, when dumbCalculator starts, python need to 'give up' its shell.
Any comments?
Thanks a lot!

A:

Either of these two commands will run an interactive program for you and return to Python when the program ends. They will not necessarily return a value from that program. 'bc' is an interactive calculator for testing. It will let you add numbers and then return to Python when you type 'quit'. 
>>> os.system("bc")

>>> subprocess.call("bc")

