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")
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |