I'm trying to run a program using a python program. The program is supposed to run the program, get the output, and write it to a text file. The program being run (which is an exe), takes one argument, so I used:
subprocess.call(["path", "arg"])
This works fine, but the problem is when I write it to the file I get:
TypeError: argument 1 must be string or read-only character buffer, not int
I tried:
str(subprocess.call(["path", "arg"]))
Theres no error with this, but it only writes zero to the text file, not the real output of the program. Is there any way to either convert the output to a string or another command where it already is string?