For some reason, the output returns like this instead of how it should be: Listed; one under the other; organized.
consulta.py
from socket import socket, AF_INET, SOCK_STREAM
from sys import argv
import pyfiglet
ascii_banner = pyfiglet.figlet_format("WHOIS - Gustang")
print (ascii_banner)
host = 'whois.iana.org'
port = 43
conn = host, port
crlf = b'\r\n'
bufsiz = 2172
if len(argv) == 2:
with socket(AF_INET, SOCK_STREAM) as s:
s.connect(conn)
ba = bytearray()
ba.endswith(crlf)
s.send(f'{argv[1]}\r\n'.encode())
resp = s.recv(bufsiz)
print (resp)