Closed SoodabehGhaffari closed 1 year ago
Hi @SoodabehGhaffari, One possible way is to run "python first_example.py" as a subprocess in a parent python script. The parent script:
import subprocess
with open('myfile.log', "w") as outfile:
subprocess.run(["python","first_example.py"], stdout=outfile)
@SoodabehGhaffari I believe that all information in the STDOUT (a.k.a log.out) is also available directly from Python.
Hello, I am using the python script to do docking and I need the binding energy which outputs to the terminal to be saved to a file. One way is to do python dock.py > log.out, but I was wondering if I can get the log file by changing something in the python script. The python script that I am using is the same as first_example.py in your github.
Thank you