[Tutor] IPcount = 0 when used with subprocess.call (use something to convert to integer?)
Rogelio
scubacuda at gmail.com
Tue May 8 06:06:12 CEST 2012
On Mon, May 7, 2012 at 8:09 PM, Rogelio <scubacuda at gmail.com> wrote:
> Why does IPcount not equal 46? Is this what the stout is for?
FWIW, I think this seems to fix it and make IPcount an integer.
import os
IPcount = os.popen("wc -l file.txt | awk '{print $1}'").read()
print "You have",IPcount,"IP addresses that are alive."
More information about the Tutor
mailing list