Python Forum
[Tkinter] How to get the result of a ping to show in tkinter?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] How to get the result of a ping to show in tkinter?
#1
Do anyone knows how to let ping to print in the tkinter GUI, not on the terminal
i had tried many methods and find on the net just couldn't find a method to solve it.
Many resource mention on subprocess or thread related methods.
Could anyone help me, please?
Thanks and really appreciate.


import sys
import os
from tkinter import *
def ping():
    myinptext = entry.get()
    os.system("ping "+entry.get()+" -n 2" )
myGui = Tk()
entry = StringVar() 
myGui.geometry('300x300')
myGui.title("Get output inside GUI") 
mylabel = Label(myGui,text="Enter target IP or host as required.").pack() 
mybutton = Button(myGui,text ="Ping Test",command = ping).pack() 
myEntry = Entry(myGui,textvariable=entry)
myEntry.insert(-1,"8.8.8.8")
myEntry.pack()
myGui.mainloop()
Reply


Messages In This Thread
How to get the result of a ping to show in tkinter? - by jacklee26 - Jun-09-2019, 06:50 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to add two numbers and pass the result to the next page in tkinter? pymn 7 4,396 Feb-15-2022, 04:40 AM
Last Post: pymn
  Show the result of every count George87 10 2,743 Dec-28-2021, 10:03 PM
Last Post: deanhystad
  [Tkinter] Result not change using Tkinter cmala 2 2,785 May-17-2019, 08:12 AM
Last Post: cmala
  [Tkinter] How to show and hide tkinter entry box when select yes from drop down Prince_Bhatia 1 10,538 Jun-12-2018, 08:05 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020