-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathwho.py
36 lines (26 loc) · 760 Bytes
/
who.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from tkinter import *
import whois
root = Tk()
root.title("Domain Name Lookup")
root.geometry('500x550')
# Lookup Function
def lookup():
# Delete Text in box
my_text.delete(1.0, END)
# Get Domain Info
domain = my_entry.get()
domain_info = whois.whois(domain)
# Loop the output
for key, value in domain_info.items():
# Output to text box
my_text.insert(1.0, f'{key} : {value}' + '\n\n')
# GUI
my_frame = LabelFrame(root, text="Lookup Domain Name")
my_frame.pack(pady=20)
my_entry = Entry(my_frame, font=("Helvetica", 18))
my_entry.grid(row=0, column=0, pady=10, padx=10)
my_button = Button(my_frame, text="Lookup Domain", command=lookup)
my_button.grid(row=0, column=1, padx=10)
my_text = Text(root, width=50)
my_text.pack()
root.mainloop()