During programming, I opened two Python shells, one as the server and the other as the client. Then, you can directly compile the next line at the command prompt, and feel that you are using a set of advanced command lines instead of programming.
Server
>>> Import socket
>>> Sersock = socket. socket (socket. af_inet, socket. sock_stream)
>>> Sersock. BIND ('', 7777 ))
>>> Sersock. Listen (5)
>>> CS, ADDR = sersock. Accept ()
>>> F = open ('C: // aaa.exe ', 'rb ')
>>> While true:
... Data = f. Read (1024)
... If not data: Break
... While Len (data)> 0:
... Sent = cs. Send (data)
... Data = data [sent:]
...
>>> CS. Close ()
Client
>>> Import socket
>>> Cs = socket. socket (socket. af_inet, socket. sock_stream)
>>> CS. Connect ('127. 0.0.1 ', 127 ))
>>> F=open('bbb.exe ', 'wb ')
>>> While true:
... Data = cs. Recv (1024)
... If not data: Break
... F. Write (data)
...
>>> F. Flush ()
>>> F. Close ()