Created
October 30, 2018 10:49
-
-
Save RazorSh4rk/3b8a66487ffaec4373a8c96e32f42c6d to your computer and use it in GitHub Desktop.
Python GUI server pinging app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tkinter, os | |
window = tkinter.Tk() | |
def callbk(): | |
_res = os.system('ping -c 1 ' + ent.get()) | |
res.configure(text='success' if _res == 0 else 'fail') | |
lbl = tkinter.Label(window, text='IP: ') | |
ent = tkinter.Entry(window) | |
btn = tkinter.Button(window, text='ping', command=callbk) | |
res = tkinter.Label(window, text='...') | |
lbl.pack() | |
ent.pack() | |
btn.pack() | |
res.pack() | |
window.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment