Skip to content

thenanosoft/find-my-ip-address-python-gui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

find-my-ip-address-python-gui

Get Hostname & IP Address using Python GUI

First install GUI Library

pip install dearpygui

Find Hostname

hostname = socket.gethostname()

Find IP Address

hostname = socket.gethostname()

ipAddr = socket.gethostbyname(hostname)

Complete Code

Display Hostname & IP Address in Python GUI

"""
@author: Nanosoft
@website: www.thenanosoft.com
"""

from dearpygui.dearpygui import *
import socket

#get hostname
hostname = socket.gethostname()

#get host ip address
ipAddr = socket.gethostbyname(hostname)

# display text in gui window
add_text("Hostname: - " + hostname)

add_text("My Ip Address: - " + ipAddr)

#Title of the GUI window
set_main_window_title("IP Address - Python GUI")

#gui width & high size (w,h)
set_main_window_size(250, 100)

# user can't reset the window size on runtime
set_main_window_resizable(False)

start_dearpygui()

The Final Output Is:

IP Address Python GUI image


Follow Us on

Youtube | Facebook | Twitter | Instagram