Build onlien diary program
Use your own computer as server and client to write diary.
Server has the diary file, and respond to client requests.
Client can read, write diary through requests.
Client send request to write or quit.
As aboved, the diary content display once the client connects to the server.
Once the program start, automately display diary content
When user send a line of text, save it automately.
When user ask to quit, exit.
TCP/IP, socket concept
The server can send bytes, which should be converted to string in client, vice versa.-string to bytes: .encode(),bytes to string: .decode()
.encode()
.decode()
Use Enter to quit can't work in server, so change it to 'Q'.
TCP/IP socket course in chinesearrow-up-right
Brief example of socketarrow-up-right
Github Code Link for serverarrow-up-right Github Code Link for clientarrow-up-right
Last updated 7 years ago