(self, host='', port=0, timeout=-999, source_address=None)
return self.welcome
Connect to host.  Arguments are:
         - host: hostname to connect to (string, default previous host)
         - port: port to connect to (integer, default previous port)
         - timeout: the timeout to set against the ftp socket(s)
         - source_address: a 2-tuple (host, port) for the socket to bind
           to as its source address before connecting.
Connect to host.  Arguments are:
         - host: hostname to connect to (string, default previous host)
         - port: port to connect to (integer, default previous port)
         - timeout: the timeout to set against the ftp socket(s)
         - source_address: a 2-tuple (host, port) for the socket to bind
           to as its source address before connecting.
Connect to host . Arguments are : - host : hostname to connect to ( string default previous host ) - port : port to connect to ( integer default previous port ) - timeout : the timeout to set against the ftp socket ( s ) - source_address : a 2 - tuple ( host port ) for the socket to bind to as its source address before connecting .
def connect(self, host='', port=0, timeout=-999, source_address=None):
        '''Connect to host.  Arguments are:
         - host: hostname to connect to (string, default previous host)
         - port: port to connect to (integer, default previous port)
         - timeout: the timeout to set against the ftp socket(s)
         - source_address: a 2-tuple (host, port) for the socket to bind
           to as its source address before connecting.
        '''
        if host != '':
            self.host = host
        if port > 0:
            self.port = port
        if timeout != -999:
            self.timeout = timeout
        if self.timeout is not None and not self.timeout:
            raise ValueError('Non-blocking socket (timeout=0) is not supported')
        if source_address is not None:
            self.source_address = source_address
        sys.audit("ftplib.connect", self, self.host, self.port)
        self.sock = socket.create_connection((self.host, self.port), self.timeout,
                                             source_address=self.source_address)
        self.af = self.sock.family
        self.file = self.sock.makefile('r', encoding=self.encoding)
        self.welcome = self.getresp()
        return self.welcome
def connect ( self , host = '' , port = 0 , timeout = - 999 , source_address = None ) : if host != '' : self . host = host if port > 0 : self . port = port if timeout != - 999 : self . timeout = timeout if self . timeout is not None and not self . timeout : raise ValueError ( 'Non-blocking socket (timeout=0) is not supported' ) if source_address is not None : self . source_address = source_address sys . audit ( "ftplib.connect" , self , self . host , self . port ) self . sock = socket . create_connection ( ( self . host , self . port ) , self . timeout , source_address = self . source_address ) self . af = self . sock . family self . file = self . sock . makefile ( 'r' , encoding = self . encoding ) self . welcome = self . getresp ( ) return self . welcome