Jason Veldicott wrote: > subprocess.Popen(["C:\\Program Files > (x86)\\Java\\jdk1.7.0_05\\bin\\java.exe", "-cp > c:\\antlr\\antlr-3.4-complete.jar org.antlr.Tool", > "C:\\Users\\Jason\\Documents\\antlr\\java grammar\\Java.g"], > stdout=subprocess.PIPE, shell=True ).communicate() > > > Obviously, some trick is being missed. Could anyone shed light on what it > may be?
File names with spaces can be tricky. Try thoroughly separating the individual arguments and let subprocess do the necessary escaping. I think it should be subprocess.Popen([ "C:\\Program Files (x86)\\Java\\jdk1.7.0_05\\bin\\java.exe", "-cp", "C:\\antlr\\antlr-3.4-complete.jar", "org.antlr.Tool", "C:\\Users\\Jason\\Documents\\antlr\\java grammar\\Java.g"], stdout=subprocess.PIPE).communicate() -- http://mail.python.org/mailman/listinfo/python-list