I want to open a TCP client socket in Python. Do I have to go through all the low-level BSD create-socket-handle / connect-socket stuff or is there a simpler one-line way?
Opening sockets in python is pretty simple. You really just need something like this:
import socket sock = socket.socket() sock.connect((address, port))
and then you can send() and recv() like any other socket
send()
recv()
2.1m questions
2.1m answers
60 comments
57.0k users