I used the argv first to check the inputs and use argparse to parse the command line. Then I initialize a server and send hello message to the server and I need to address the "find" message it sent back to me. And I will send the count message to the server again. Last, I use a loop to get data back and handle with find and bye. After it has "bye" data, I get the flag and close the server.
The main challenge for me is that I spent time understanding the protocol. A demo would be great for the future homework specification. Also, at first I ignore that the server may send multiple data back if one line is not enough.