vim print_num.py
print(111)
vim test.py
import subprocess
cmd = ['python', 'print_num.py']
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
p.wait()
out = p.stdout.read()
print(out)
print(eval(out))
python test.py
b'111\n'
111