On Jun 21, 3:49 pm, Christian Heimes <[email protected]> wrote: > Nate wrote: > > gmapcreator = subprocess.Popen("java -Xms128M -Xmx512M -jar > > gmapcreator.jar -dfile=censettings.xml", stdin=subprocess.PIPE, > > stdout=subprocess.PIPE, stderr=subprocess.PIPE) > > Try this: > > gmapcreator = subprocess.Popen( > ["java", "-Xms128M", "-Xmx512M", "-jar", "gmapcreator.jar", > "-dfile=censettings.xml"], stdin=subprocess.PIPE, > stdout=subprocess.PIPE, stderr=subprocess.PIPE) > > out, err = gmapcreator.communicate("stdin input") > > The subprocess doesn't use the shell so you have to apply the command as > a list of strings. > > Do you really need stdin, stdout and stderr as pipes? If you aren't > carefully with the API your program can block. > > Christian
Christian, Thanks for your response. Related to this talk about shells, maybe you could point me towards a resource where I could read about how windows commands are processed w/w/o shells? I guess I assumed all subprocess commands were intepreted by the same thing, cmd.exe., or perhaps the shell. I guess this also ties in with me wondering what the whole subprocess Popen instantiation encompassed (the __init__ of the subprocess.Popen class?). I don't think I need stdin, stdout, stderr as pipes, I just was faced with several options for how to capture these things and I chose subprocess.PIPE. I could also os.pipe my own pipes, or create a file descriptor in one of a couple of ways, right? I'm just unclear on which method is preferable for me. All I want to do is pull the first 2 lines from the output before gmapcreator.jar finishes. The first 2 lines of output are always the same except a few numbers. -- http://mail.python.org/mailman/listinfo/python-list
