The ftplib module from the standard library only covers the client part of the FTP protocol.
So what you did is trying to open two connections to 121.0.0.1
. I'm assuming you meant localhost
, which is 127.0.0.1
anyway.
Not knowing what you are actually trying to achieve, there are some options:
- transfer files using HTTP, use
python -m SimpleHTTPServer
(orpython3 -m http.server
in python3) and requests as client - use a prexisting solution (see the answers to One line ftp server in python)
- implement your own server