Created
April 28, 2024 16:15
-
-
Save Steigner/23eadd792b333a14a77d46ed59c059e9 to your computer and use it in GitHub Desktop.
Quickly find devices on the network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !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