From 03459db40ac5b298ad74d02e5bbfaa3d24980c85 Mon Sep 17 00:00:00 2001 From: Hossein Koofi Date: Tue, 16 Mar 2021 20:21:36 +0330 Subject: [PATCH 1/3] Update ping.py --- ping.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/ping.py b/ping.py index ab18d2f..c6d5da7 100644 --- a/ping.py +++ b/ping.py @@ -1,7 +1,7 @@ import platform # For getting the operating system name import subprocess # For executing a shell command from tkinter import * -import sys +#import sys def ping(): """ @@ -21,14 +21,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() @@ -38,21 +43,27 @@ def res_fun(): else: messagebox.showinfo('Result','You have entered an correct ip') + +############################################################ +# GLOBAL SECTION # +############################################################ + + window = Tk() 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) From b9e52213b68d155fc5f624dfd8d5c2812d340de6 Mon Sep 17 00:00:00 2001 From: Hossein Koofi Date: Tue, 16 Mar 2021 20:28:15 +0330 Subject: [PATCH 2/3] Updating the readme --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5563d6a..5244ff1 100644 --- a/README.md +++ b/README.md @@ -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. + + + From 90dd363f267b7435320b4dd68c0f9daa9eb58780 Mon Sep 17 00:00:00 2001 From: Hossein Koofi Date: Tue, 16 Mar 2021 20:35:38 +0330 Subject: [PATCH 3/3] Adding Icon --- ip.ico | Bin 0 -> 1150 bytes ping.py | 11 +++++++++++ 2 files changed, 11 insertions(+) create mode 100644 ip.ico diff --git a/ip.ico b/ip.ico new file mode 100644 index 0000000000000000000000000000000000000000..eb4e0dfd8d564521c95e0fa12e9f7d66e13b5f2d GIT binary patch literal 1150 zcmb7^u}T9$5Qaw-loauhV5?=Gz`{cD1;o-ytVBbw6bm6};RA@ZU?ai8CrBZ|Ld3$# z+8|h1h=@p#pngBM8zy>*xeZ@-Z)U#P-Gjtzgin$f-?O$kW;ShRWgtW(jWgvMt*xa3 z)B}Y)GEM?l@Ey2jo*JeHb#iZm7k$llP#V;O`~)7{peG zaAS{k-vCeV`YDJ1Ol>jtV7-yy9un(-=D4q)E6zX9sF^3$hJ}or`dm1_@vBDr&cO$i zU>Vfs1>zYR&OdYUnD_gCl3#-xS66p_)y1Q~M@;8f3G9aFnBR83&iDo~_uu?Zt$t?R z!E+^tU+s!+fxiQ~Yrp-KQ;oBFm*mQD1oxmj39XMoe+xb1t7g_&G;7b8y-u1vjHg_V Unu&vbXu+vj^D&L7MzwN&0FwH(=>Px# literal 0 HcmV?d00001 diff --git a/ping.py b/ping.py index c6d5da7..64bca06 100644 --- a/ping.py +++ b/ping.py @@ -1,3 +1,12 @@ +""" +@author: Hossein Koofi +@author: Iliya yadegari +""" + + + + + import platform # For getting the operating system name import subprocess # For executing a shell command from tkinter import * @@ -50,6 +59,8 @@ def res_fun(): window = Tk() +window.title("VT Pinger") +window.iconbitmap("ip.ico") r = IntVar()