I have a pretty big script and I need to output what the user typed in, and what the response of the program was. Trouble is my big file.
import subprocess
with open("output.txt", "wb") as f:
subprocess.check_call(["python", "trouble.py"], stdout=f)
The following code works fine except it doesn't display anything from trouble.py on my command prompt but it still writes to output.txt.
import troube
When I add this, the program runs correctly (runs as if I was just running the file normally) but doesn't output anything.
How do I go about doing this? Thanks