Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
network programming
#1
Hi Folks,
I am trying to use the following script to check if the IP is active or not, but the result shows active irrespective of the actual status.

Confused


import sys,os

server_ip = '192.168.6.15'
rep = os.system('ping ' + server_ip)
if rep == 0:
print ('server is up ')
else:
print ('server is down')
Reply


Messages In This Thread
network programming - by karan - Jul-03-2018, 10:50 AM
RE: network programming - by Larz60+ - Jul-03-2018, 10:54 AM
RE: network programming - by buran - Jul-03-2018, 12:49 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020