Use passive or active mode for data transfers. With a false argument, use the normal PORT mode, With a true argument, use the PASV command.
ftplib/FTP.set_pasv
FTP.set_pasv