Home > Article > Backend Development > Python builds HTTP server and FTP server
This article mainly introduces the relevant information of Python to build HTTP server and FTP server in detail. It has certain reference value. Interested friends can refer to it.
This tutorial is shared with everyone. The specific steps to build HTTP server and FTP server in Python are for your reference. The specific content is as follows
The default installation version is python2.7
http server setupTutorial :
Enter the directory to be opened for access and execute the command: python -m SimpleHTTPServer 9000
## If the above is displayed, the installation is successful and the http service is The port is: 9000, the default port is 80 if not used Access the http service through the browser: http://localhost:9000The page is displayed as follows: The server side displays as follows: indicates that the request was received successfully. The following is theftp server setup tutorial:
python does not come with its own ftp service library, so you need to install the plug-in: Enter the Python27\scripts directory, Execute: pip install pyftpdlib command, the display is as follows, which means the installation is successful Enter the ftp service directory that needs to be opened, execute: python -m pyftpdlib -p 21, the display is as follows, Indicates that the ftp service is successfully established Access through the browser ftp://localhost:21. The following display indicates that the access is successful: The server displays the following, indicating that the request was received successfully:The above is the detailed content of Python builds HTTP server and FTP server. For more information, please follow other related articles on the PHP Chinese website!