ftplib.FTP.connect()

FTP.connect(host='', port=0, timeout=None, source_address=None) Connect to the given host and port. The default port number is 21, as specified by the FTP protocol specification. It is rarely needed to specify a different port number. This function should be called only once for each instance; it should not be called at all if a host was given when the instance was created. All other methods can only be used after a connection has been made. The optional timeout parameter specifies a timeout

ftplib.FTP.dir()

FTP.dir(argument[, ...]) Produce a directory listing as returned by the LIST command, printing it to standard output. The optional argument is a directory to list (default is the current server directory). Multiple arguments can be used to pass non-standard options to the LIST command. If the last argument is a function, it is used as a callback function as for retrlines(); the default prints to sys.stdout. This method returns None. Note If your server supports the command, mlsd() offers a

ftplib.FTP.login()

FTP.login(user='anonymous', passwd='', acct='') Log in as the given user. The passwd and acct parameters are optional and default to the empty string. If no user is specified, it defaults to 'anonymous'. If user is 'anonymous', the default passwd is 'anonymous@'. This function should be called only once for each instance, after a connection has been established; it should not be called at all if a host and user were given when the instance was created. Most FTP commands are only allowed afte

ftplib.FTP.getwelcome()

FTP.getwelcome() Return the welcome message sent by the server in reply to the initial connection. (This message sometimes contains disclaimers or help information that may be relevant to the user.)

ftplib.error_reply

exception ftplib.error_reply Exception raised when an unexpected reply is received from the server.

ftplib.FTP

class ftplib.FTP(host='', user='', passwd='', acct='', timeout=None, source_address=None) Return a new instance of the FTP class. When host is given, the method call connect(host) is made. When user is given, additionally the method call login(user, passwd, acct) is made (where passwd and acct default to the empty string when not given). The optional timeout parameter specifies a timeout in seconds for blocking operations like the connection attempt (if is not specified, the global default t

ftplib.FTP.close()

FTP.close() Close the connection unilaterally. This should not be applied to an already closed connection such as after a successful call to quit(). After this call the FTP instance should not be used any more (after a call to close() or quit() you cannot reopen the connection by issuing another login() method).

ftplib.error_proto

exception ftplib.error_proto Exception raised when a reply is received from the server that does not fit the response specifications of the File Transfer Protocol, i.e. begin with a digit in the range 1–5.

ftplib.error_temp

exception ftplib.error_temp Exception raised when an error code signifying a temporary error (response codes in the range 400–499) is received.

ftplib.FTP.abort()

FTP.abort() Abort a file transfer that is in progress. Using this does not always work, but it’s worth a try.