Python Programming Modify the multi-client chat room application below so that it maintains the chat record in a text file. The record should load the text from the file at instantiation and save each message as it is received. client.py from socket import * from codecs import decode HOST = 'localhost' PORT = 5000 BUFSIZE = 1024 ADDRESS = (HOST, PORT) CODE = 'ascii' server = socket(AF_INET, SOCK_STREAM) server.connect(ADDRESS) print(decode(server.recv(BUFSIZE), CODE)) name = input('Enter your name') server.send(bytes(name, CODE)) while True: record = decode(server.recv(BUFSIZE), CODE) if not record: print("Server disconnected")
Get Free Quote!
296 Experts Online