Apr-06-2017, 02:43 PM
Hello Guyz,
Here i am writing a script by pinging an ip continously.
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.
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.