#!/usr/bin/python import socket my_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #the first parameter indicates that #the socket is an internet socket #and the second parameter indicates #that it uses TCP HOST = "127.0.0.1" # Loopback interface PORT = 1060 # Sufficiently obscure port my_socket.connect((HOST, PORT)) # my_socket.close()