The first step is to import ftplib. As mentioned in the guides on
building a simple
web server and building a
web client, the socket
module is used by most every Python module that needs to interface
with a port. The FTP library is no different. It relies primarily on
the SOCKS module but defers to the
socket module if the former is not
found. The socket module ships with standard Python.
The ftplib module takes care of creating the socket connection and
maintaining it. So fire up your favourite text editor and enter the
following:
import ftplib
Next, we will look at how to initiate the connection.