I'm writing a code in which inside of it I need to run another python file which I have the path for it , and to save its output ( the exception it returns or the output it self ). Can someone guide me ? I tried subprocess but it doesn't run :
import subprocess
output = call ('python' , filePath)
thanks in advance
subprocess? For that matter, did you read the documentation in general (the code shown does not correctly importsubprocess.call)? Note thatsubprocess.runandsubprocess.check_outputare more appropriate for what you intend to do.