Save and load client messages in Python | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Save and load client messages in Python

I have simple client server chat. Does anybody Has idea how to save chat history since host is running? New client connects to the chat and then he receive all history. File with history is deleted after host disconnect.

14th Mar 2019, 5:20 PM
Buckethead
Buckethead - avatar
1 ответ
+ 3
You could append the log to a file on the server, or save it in a database. For example the built in sqlite3 engine would work too. https://docs.python.org/3.7/library/sqlite3.html
16th Mar 2019, 2:44 PM
Tibor Santa
Tibor Santa - avatar