On Mon, May 07, 2012 at 08:09:55PM -0700, Rogelio wrote:

> import subprocess
> IPcount = subprocess.call(['wc -l file.txt | awk \'{print $1}\''], shell=True)
> print "You have",IPcount,"IP addresses that are alive."
> 
> I get the following output
>
> 46
> You have 0 IP addresses that are alive.
> 
> Why does IPcount not equal 46?  Is this what the stout is for?

Yes. The output of the call gets written to stdout. The return result of 
the call is 0 if the call succeeded and some other integer if it failed.


-- 
Steven

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to