Quantcast
Channel: Active questions tagged whois - Stack Overflow
Viewing all articles
Browse latest Browse all 47

Trying to create a whois in python but it doesn't run

$
0
0

For some reason, the output returns like this instead of how it should be: Listed; one under the other; organized.

Reference:https://i.stack.imgur.com/HkKDZ.png

consulta.py

from socket import socket, AF_INET, SOCK_STREAMfrom sys import argvimport pyfigletascii_banner = pyfiglet.figlet_format("WHOIS - Gustang")print (ascii_banner)host = 'whois.iana.org'port = 43conn = host, portcrlf = b'\r\n'bufsiz = 2172if 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)

Viewing all articles
Browse latest Browse all 47

Trending Articles