python 2.7 network socket connect code example Example: socket hostname socket.gethostbyname(socket.gethostname())