ommit os library
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import os
|
||||
import utilities
|
||||
import sys
|
||||
|
||||
endereco = input("Digite um endereço IP: ")
|
||||
|
||||
if not utilities.validar_ip(endereco):
|
||||
print ("O endereço IP é inválido.")
|
||||
sys.exit(0)
|
||||
|
||||
comando = f"ping {endereco}"
|
||||
|
||||
resultado = os.system(comando)
|
||||
|
||||
if not resultado:
|
||||
print("O endereço existe")
|
||||
else:
|
||||
print("O endereço não existe")
|
||||
Reference in New Issue
Block a user