The first option:
Python provides subprocess
package to perform this task. You need to use pipes provided with subprocess package. Reference here.
The second option:
You can use multiprocessing
package for better control and more options; pipes still available. Additionally you can use Queue, Array and Lock to facilitate interprocess communication. Reference here.