Losing words

John Doe john at johniedoe.com
Mon Apr 1 16:10:33 EDT 2019


On 2019-04-01, Abdur-Rahmaan Janhangeer <arj.python at gmail.com> wrote:
> Since this is IRC, you might want to see a demo here:
> https://github.com/Abdur-rahmaanJ/honeybot/blob/master/honeybot/main.py


Yes. However get these def text() and loop while 1: working together.

def text():
    while True:
        mess = input("> ")
        print(mess)
        s.send(bytes("PRIVMSG " + " "+ channel + " " + ":" + mess  + "\n", "UTF-8"))

text()

while 1:
    data = s.recv(4096).decode('utf-8')
    print(data)
    if data.find('PING') != -1:
        s.send(str('PONG ' + data.split(':')[1] + '\r\n').encode())
        print('PONG sent \n')



s.close()




More information about the Python-list mailing list