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
#2
Have a look at tkinters after method
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
Download my project scripts


Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Button to stop while loop from another script Absolutewind 5 3,016 Sep-25-2023, 11:20 PM
Last Post: deanhystad
  Need some guidance on a script to ping a list of ip's cubangt 11 7,032 Aug-10-2023, 02:39 PM
Last Post: snippsat
  Script stop work after 3 actioins - PLEASE WHERE IS THE PROBLEM? rondon442 0 2,046 Sep-27-2021, 05:40 PM
Last Post: rondon442
  cant use ping, sudo or other commands in remote shell script. throwaway34 7 5,246 May-17-2021, 11:29 AM
Last Post: throwaway34
  Ping command using python 3.6.5 Martin2998 6 28,031 Apr-19-2021, 06:24 PM
Last Post: blazejwiecha
  How can I stop the script when I run the game on my own computer? StatTark 2 3,109 Jun-19-2020, 11:20 AM
Last Post: StatTark
  Create a program that PING a list of IPs skaailet 7 10,220 Mar-26-2020, 10:46 PM
Last Post: snippsat
  how to stop and start a script for 30 seconds laspaul 9 11,655 Jan-16-2020, 02:13 PM
Last Post: laspaul
  ping with output jacklee26 1 6,185 Nov-28-2019, 01:01 PM
Last Post: Axel_Erfurt
  PING PONG GAME akea 0 6,412 May-08-2019, 04:30 PM
Last Post: akea

Forum Jump:

User Panel Messages

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