thedata = (
    """
Questa mattina
mi son svegliato
o bella ciao, bella ciao,
bella ciao, ciao, ciao
questa mattina
mi son svegliato
ho trovato l'invasor!
"""
    .splitlines(True))


class Push(protocol.Protocol):
    """This is just about the simplest possible protocol"""

def connectionMade(self):
    for line in thedata:
        if not line or line.isspace():
            continue
self.transport.write(line)
time.sleep(1.0)
self.transport.loseConnection()
Twisted: tcp server with push producer example?