Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the FTP class in Python learning notes

Shulou Source: shulou.com Published: 2022-06-02 23:36:45 10月17日 Update

In Python learning notes on how to use FTP class, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

If you encounter the introduction of the common methods of the FTP class in the Python learning notes in the practical application of Python learning notes, the following is an introduction of its related content, if you are interested in this aspect, you can browse the following articles. I hope it will be helpful to you.

Class FTP ([host [, user [, passwd [, acct]):

If host is specified, the connection will be called. If the user name and password are specified, login will be called.

Connect (host [, port]):

Connect to the server

Login ([user [, passwd [, acct]):

Log in to the server; log in anonymously without specifying user; abort (): terminate the transfer of a file

Sendcmd (command):

Send a simple command and get the return

Retrbinary (command,callback [, maxblocksize [, rest]]):

Get a binary file, and callback is called back when the data block is received; the command should be the 'RETR filename';rest parameter to specify the number of offset bytes at the beginning of the file

Retrlines (command [, callback]):

Get a list of files or directories, usually the 'RETR' or' LIST' command; callback is a method that takes a string argument

Set_pasv (boolean):

Set whether to be in passive mode

Storbinary (command,file [, blocksize]):

Save a binary file, the command is usually "STOR filename", file is an open file object; the above article is part of the introduction to the practical application of Python learning notes.

After reading the above, have you mastered how to use the FTP class in the Python learning notes? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Files notes learning commands methods content login binary parameters actual articles more servers directories problems applications services helpless for this interest Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Xiaomi macOS Redmi Huawei