os.system vs subprocess

Chris Rebert clp2 at rebertia.com
Sun Jun 21 14:12:29 EDT 2009


On Sun, Jun 21, 2009 at 10:12 AM, Nate<walton.nathaniel at gmail.com> wrote:
> I get different behavior with os.system and subprocess (no surprise
> there I guess), but I was hoping for some clarification, namely why.
>
> If I type this directly into the command window:
>
> java -Xms128M -Xmx512M -jar gmapcreator.jar -dfile=censettings.xml >
> mapoutput.txt
>
> mapoutput.txt stores the output:
> Command line mode: input file=censettings.xml
> 1358 files will be created in C:\Documents and Settings\Nate\Desktop
> \freqanalysis\tilefiles\CENSUS1-tiles
> 1358 tiles created out of 1358 in 16 seconds
>
> If I execute said command with subprocess, the output is not written
> to mapoutput.txt - the output just appears in the command window.

Show us the subprocess version of you code. People tend to not get the
parameters quite right if they're not familiar with the library.

Cheers,
Chris
-- 
http://blog.rebertia.com



More information about the Python-list mailing list