I'm trying to pass arguments to my test_script.py but I'm getting the following error. I know this isn't the best way to do this but it's the only one that will work since I won't know what functions are in test_script.py. How can I pass arguments as stdin input?
test_script.py
a = int(input())
b = int(input())
print(a+b)
main_script.py
try:
subprocess.check_output(['python', 'test_script.py', "2", "3"], stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
print(e.output)
Error
b'Traceback (most recent call last):\r\n File "test_script.py", line 1, in <module>\r\n a = int(input())\r\nEOFError: EOF when reading a line\r\n'