Skip to content

Instantly share code, notes, and snippets.

@Steigner
Created April 28, 2024 16:15
Show Gist options
  • Save Steigner/23eadd792b333a14a77d46ed59c059e9 to your computer and use it in GitHub Desktop.
Save Steigner/23eadd792b333a14a77d46ed59c059e9 to your computer and use it in GitHub Desktop.
Quickly find devices on the network
# !pip install ping3
import ping3
def ping_device(ip_address):
result = ping3.ping(ip_address)
if result is not None:
print(f"Device {ip_address} is reachable. Round-trip time: {result} ms")
else:
print(f"Device {ip_address} is unreachable.")
for i in range(254):
ping_device('127.0.0.' + str(i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment