Goodmorning,
I need to create a script schedule, inside this script I need to call a batch file.
I try to use the python module subprocess, but the bat script was never execute.
I try to use two different code:
======FIRST======
import subprocess
subprocess.call([r’D:\Script\Call_SFTP_KOJ002.bat’], shell=True)
======SECOND======
from subprocess import Popen
p = Popen([“D:/Script/Call_SFTP_KOJ002.bat”], shell=True)
p.wait
stdout, stderr = p.communicate()
print p.returncode
I prefer the second one because I can see if the command will be execute and is possible to write the result in log file
Can somebody help me?
Thanks
Carlo