python tkinter IP地址查询程序
import socket
from tkinter import *


class ipAddress:
    def __init__(self):
        window = Tk()
        window.title("ipAddress")

        frame = Frame(window)
        frame.pack()

        Label(frame, text="域名:").grid(row=1, column=1)

        self.ipName = StringVar()
        Entry(frame, textvariable=self.ipName).grid(row=1, column=2)

        Button(frame, text="查找", command=self.getIpAddress).grid(row=1, column=3)

        self.toString = StringVar()
        label = Label(window, textvariable=self.toString, anchor=NW, font=("consolas", 15), bg="white", height=15,
                      width=60)
        label.pack()

        window.mainloop()

    def getIpAddress(self):
        try:
            ipAddress = socket.gethostbyname(self.ipName.get())
            self.toString.set(str(self.ipName.get()) + "的IP地址为:" + str(ipAddress))
        except:
            self.toString.set("请输入正确的域名!")


ipAddress()
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇