On Saturday, 23 November 2013 14:23:08 UTC-8, Chris Angelico wrote: > On Sun, Nov 24, 2013 at 9:15 AM, Bhanu Karthik > > <bhanukarthik2...@gmail.com> wrote: > > > data = sock.recv(RECV_BUFFER) > > > username = str(sock.getpeername()) > > > username = usernames[username] > > > if command == "/quit": > > > print data > > > sock.send("bye") > > > sock.close() > > > CONNECTION_LIST.remove(sock) > > > > > > even if the received data is '/quit' the if condition not excuting...please > > help. > > > > At what point is command set? You're setting data here; is command > > supposed to be derived from data? > > > > This looks like a MUD or IRC style of server, which would suggest that > > commands are terminated by end-of-line. You may need to take content > > from the socket (currently in data) and split it off on either "\r\n" > > or "\n". But it's hard to tell from this small snippet. > > > > ChrisA
data = sock.recv(RECV_BUFFER) username = str(sock.getpeername()) username = usernames[username] if data == "/quit": print data sock.send("bye") sock.close() CONNECTION_LIST.remove(sock) this is exact code.. it is not even entering the if ... I tried ( c= (data is '/quit')if c) when i print c ,its printing false....I dont understand what is happening...please help.. -- https://mail.python.org/mailman/listinfo/python-list