Re: Python,ping,csv

2016-04-11 Thread Jason Friedman
> I added a line. > I would need to put the output into a csv file which contained the > results of the hosts up and down. > Can you help me? > > import subprocess > from ipaddress import IPv4Network > for address in IPv4Network('10.24.59.0/24').hosts(): > a = str(address) > res = sub

Re: Python,ping,csv

2016-04-11 Thread Jason Friedman
> I added a line. > I would need to put the output into a csv file which contained the results > of the hosts up and down. > Can you help me? > > > import subprocess > from ipaddress import IPv4Network > for address in IPv4Network('10.24.59.0/24').hosts(): > a = str(address) > res =

Re: Python,ping,csv

2016-04-11 Thread Smith
Il 10/04/2016 05:29, Jason Friedman ha scritto: for ping in range(1,254): address = "10.24.59." + str(ping) res = subprocess.call(['ping', '-c', '3', address]) if res == 0: print ("ping to", address, "OK") elif res == 2: print ("no response from", address)

Re: Python,ping,csv

2016-04-11 Thread Smith
Il 10/04/2016 05:29, Jason Friedman ha scritto: for ping in range(1,254): address = "10.24.59." + str(ping) res = subprocess.call(['ping', '-c', '3', address]) if res == 0: print ("ping to", address, "OK") elif res == 2: print ("no response from", address)

Re: Python,ping,csv

2016-04-09 Thread Jason Friedman
> for ping in range(1,254): > address = "10.24.59." + str(ping) > res = subprocess.call(['ping', '-c', '3', address]) > if res == 0: > print ("ping to", address, "OK") > elif res == 2: > print ("no response from", address) > else: > print ("ping to", addr

Re: Python,ping,csv

2016-04-08 Thread Joel Goldstick
On Fri, Apr 8, 2016 at 3:25 AM, Smith wrote: > Hello to all, > I have this little script that pings certain ip addresses. > Considering that I am a newbie to the Python programming language, can you > help me change these lines in order to put the output into a csv file? > Sorry for unclear Englis

Python,ping,csv

2016-04-08 Thread Smith
Hello to all, I have this little script that pings certain ip addresses. Considering that I am a newbie to the Python programming language, can you help me change these lines in order to put the output into a csv file? Sorry for unclear English Thanks in advance import subprocess for ping in