pyhton implementation of chat system