The "recv" and "send" functions of pwntools library are used as below.
(from pwn import *)
❑ To TCP/UDP connection
FYI. open() function is not in the pwntools library and it uses "read" and "write" functions.
❑ To open the file : f = open("newfil", 'w')
* Reference(Link)