import subprocess py2output = subprocess.check_output(['python', 'py2.py', '-i', 'test.txt']) print('py2 said:', py2output)