I have a remote server with an IP address and a port. I can connect to it using a standard command window successfully. When using the command window, I can see data flow through the window but I lack the ability to be notified if the data flow stops. I would like to use Python instead to accomplish the same task with the added feature of alerting me if/when data flow stops. I've attached the code that I've been working with below, is anyone able to help me with this process?
import sys
import telnetlib
import easygui
HOST = "###.###.###.###, 25"
tn = telnetlib.Telnet(HOST)
print tn.read_all()
tn.write("exit\n")
if data =="":
easygui.msgbox("There's no data!!", title="Bummer Box")