Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
non-stop ping script
#1
Hi, sorry for my bad English,
I have this script from online:
# import modules
from tkinter import *
from pythonping import ping
 
def get_ping():
    result = ping(e.get(), verbose=False, count=1)
    for line in result:
        SingleResult = line
        break
    res.set(SingleResult)
 
# object of tkinter
# and background set for light grey
master = Tk()
master.configure(bg='light grey')
 
# Variable Classes in tkinter
res = StringVar()
 
# Creating label for each information
# name using widget Label
Label(master, text="Enter URL or IP :", bg="light grey").grid(row=0, sticky=W)
Label(master, text="Result :", bg="light grey").grid(row=1, sticky=W)
 
# Creating lebel for class variable
# name using widget Entry
Label(master, text="", textvariable=res, bg="light grey").grid(row=1, column=1, sticky=W)
 
e = Entry(master)
e.insert(0, "www.google.com" )
e.grid(row=0, column=1)
 
# creating a button using the widget
# Button that will call the submit function
b = Button(master, text="Show", command=get_ping)
b.grid(row=0, column=2, columnspan=2, rowspan=2, padx=5, pady=5)
 
mainloop()
what I like is I want is to make the button pressed automatically every 1 second as independent without disturbing other(s) buttons (if they exist), any idea how do this?
Reply


Messages In This Thread
non-stop ping script - by kucingkembar - Aug-23-2022, 05:59 AM
RE: non-stop ping script - by menator01 - Aug-23-2022, 06:29 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Button to stop while loop from another script Absolutewind 5 960 Sep-25-2023, 11:20 PM
Last Post: deanhystad
  Need some guidance on a script to ping a list of ip's cubangt 11 1,902 Aug-10-2023, 02:39 PM
Last Post: snippsat
  Script stop work after 3 actioins - PLEASE WHERE IS THE PROBLEM? rondon442 0 1,579 Sep-27-2021, 05:40 PM
Last Post: rondon442
  Win32\ping.exe windows pops up -very annoying... tester_V 9 3,293 Aug-12-2021, 06:54 AM
Last Post: tester_V
  Looking for discord bot to make loop ping for address ip tinkode 0 1,841 Jul-26-2021, 03:51 PM
Last Post: tinkode
  cant use ping, sudo or other commands in remote shell script. throwaway34 7 3,680 May-17-2021, 11:29 AM
Last Post: throwaway34
  Ping command using python 3.6.5 Martin2998 6 17,493 Apr-19-2021, 06:24 PM
Last Post: blazejwiecha
  GPIO high if network IP has good ping duckredbeard 3 2,380 Oct-12-2020, 10:41 PM
Last Post: bowlofred
  How can I stop the script when I run the game on my own computer? StatTark 2 2,256 Jun-19-2020, 11:20 AM
Last Post: StatTark
  Create a program that PING a list of IPs skaailet 7 6,444 Mar-26-2020, 10:46 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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