Short but amazing (at least for me) intro to network programming. We start by opening two terminals: for python and netcat utility. #Python
3
0
0
0
0
Download Image
And here you are: with opened connection, listening on a port, sending bytes, including some newline stuff
Terminal N2 - start listening to arbitrary port $ netcat -l 1234 T1 - connect to it, and send >> s.connect(('', 1234)) >> s.send(b'abc\n')
Terminal N1 -- create a socket, the place where bytes will go to >> import socket >> s = socket.socket()