Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

14
  • 3
    I think you either need shell=True, or to break your command up into a list of arguments. Commented Nov 22, 2011 at 21:14
  • 1
    This is unrelated, but you could do pass in stderr=subprocess.stdout to redirect it to stdout, because as it is now, you are dropping stderr. Commented Nov 22, 2011 at 21:24
  • 1
    Please show the code at the end of the generation script that successfully calls the "running console app" script. It sounds like you're closing the XML file before calling the second script, but not before reaching the included code at the end of the single script. Commented Nov 22, 2011 at 21:24
  • 2
    Is the "separate script" in the same folder? You are using relative paths here..that could be your issue. I always use absolute paths. You can change paths into absolute paths by using os.path.abspath(pathname) and another thing that is convenient to do is get the path where your script resides (different than the working folder, which is where you started the script). SCRIPT_ROOT=os.path.split(os.path.abspath(file))[0] Commented Nov 22, 2011 at 21:26
  • 1
    @dan360: It would be subprocess.STDOUT. Commented Nov 22, 2011 at 21:42