Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
# This program ,which is enhanced with tkinter, will take a ip address and while return true or false if the ip is dead of alive.
# VT Pinger



VT Pinger is a python application that is enhanced with Tkinter and will take an IP address and checks if the IP is dead or alive.

This app is done with the help of my 12-year student Mr. Iliya Yadegari. He did the GUI part using Tkinter.



Binary file added ip.ico
Binary file not shown.
34 changes: 28 additions & 6 deletions ping.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
"""
@author: Hossein Koofi
@author: Iliya yadegari
"""





import platform # For getting the operating system name
import subprocess # For executing a shell command
from tkinter import *
import sys
#import sys

def ping():
"""
Expand All @@ -21,14 +30,19 @@ def ping():


def res_fun():

# if Ip ping requested
if r.get() == 2:

#Call the ip pinger function
res = ping()

if res == True:
messagebox.showinfo('Result','The ip is live.')
elif res == False:
messagebox.showinfo('Result','The ip is dead.')


# if Ip validation requested
elif r.get() == 1:

pingGet = ping_ent.get()
Expand All @@ -38,21 +52,29 @@ def res_fun():
else:
messagebox.showinfo('Result','You have entered an correct ip')


############################################################
# GLOBAL SECTION #
############################################################


window = Tk()
window.title("VT Pinger")
window.iconbitmap("ip.ico")

r = IntVar()

frame_1 = LabelFrame(window,text = 'Options')

Radiobutton(frame_1,text = '1- Check an ip length validity.',variable = r,value = 1).grid(row = 0, column = 0, pady = 10, padx = 10)
Radiobutton(frame_1,text = '2- Ping an IP.',variable = r,value = 2).grid(row = 1, column = 0, pady = 10, padx = 10)
Radiobutton(frame_1,text = '1- Check an ip length validity.',variable = r,value = 1).grid(row = 0, column = 0, pady = 10, padx = 10, sticky="W")
Radiobutton(frame_1,text = '2- Ping an IP.',variable = r,value = 2).grid(row = 1, column = 0, pady = 10, padx = 10, sticky="W")

ping_label = Label(frame_1,text = 'Enter your ip ===>',bg = 'yellow')

ping_ent = Entry(frame_1)

ping_label.grid(row = 3, column = 0, padx = 10, pady = 10)
ping_ent.grid(row = 3, column = 1, padx = 10, pady = 10)
ping_label.grid(row = 3, column = 0, padx = 10, pady = 10, sticky="W")
ping_ent.grid(row = 3, column = 1, padx = 10, pady = 10 )

submit_btn = Button(window,text = 'Submit',width = 20, height = 3,command = res_fun,bg = '#00e6e6').grid(row = 2, column = 0, padx = 10,pady = 10)

Expand Down