How do I call the relative path of batch file from python?
My python script 'Script.py' is in the directory "d:\2014\python\script.py"
from this file i would like to call a batch file "d:\2014\input\batch1.bat" but i want to use relative path with popen()
function.
In Script.py
import os, sys
from subprocess import Popen
p = Popen("D:\\2014\\input\\batch1.bat", cwd=r"D:\\2014\\input")
stdout, stderr = p.communicate()
the above code will work but the below code will not work
p = Popen("..\\input\\batch1.bat", cwd=r"..\\input")
stdout, stderr = p.communicate()
gives file not found error