Python Forum
Send the output from a running script
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Send the output from a running script
#1
Hello Guyz,
Here i am writing a script by pinging an ip continously.



def ip_ping():
    import subprocess
    b= "172.30.36.136"
    a = subprocess.Popen(["ping","-t", b], stdout=subprocess.PIPE).stdout.read()
    if a.count("Destination host unreachable.")>5:
        print a
ip_ping()    
when the condition satisfies, it doesn't print the output to the idle shell while the script is running.
when i close the running script it gets printed in the Idle shell.
How to print the output while the script is running?

Thanks in Advance.
Reply


Messages In This Thread
Send the output from a running script - by MeeranRizvi - Apr-06-2017, 02:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Fixing arrays output in Python WLST script pkbash 2 5,048 Feb-28-2019, 06:20 PM
Last Post: pkbash
  Running another python script from a python script buddy23 1 3,310 Dec-29-2018, 11:25 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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