January 2019
Beginner
318 pages
8h 23m
English
Once an initial connection is established, a server usually returns a welcome message. This message comes via the getwelcome() function, and sometimes includes disclaimers or helpful information that may be relevant to the user.
Now we will see an example of getwelcome(). Create a get_welcome_msg.py script and write the following content in it:
from ftplib import FTPftp = FTP('your-ftp-domain-or-ip')ftp.login('your-username','your-password')welcome_msg = ftp.getwelcome()print(welcome_msg)ftp.close()
Run the script as follows:
student@ubuntu:~/work$ python3 get_welcome_msg.py220 (vsFTPd 3.0.3)
In the preceding code, we first mentioned the IP address, username, and password of the other machine. ...
Read now
Unlock full access