Skip to content

Instantly share code, notes, and snippets.

@RazorSh4rk
Created October 30, 2018 10:49
Show Gist options
  • Save RazorSh4rk/3b8a66487ffaec4373a8c96e32f42c6d to your computer and use it in GitHub Desktop.
Save RazorSh4rk/3b8a66487ffaec4373a8c96e32f42c6d to your computer and use it in GitHub Desktop.
Python GUI server pinging app
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