Home > Backend Development > Python Tutorial > Python's one-click method to build an HTTP server

Python's one-click method to build an HTTP server

不言
Release: 2018-06-02 14:21:04
Original
2285 people have browsed it

This article mainly introduces the method of using Python to build an Http server with one click. It has certain reference value. Now I share it with you. Friends in need can refer to it.

Today a friend asked me how to start from Download the file on the Alibaba Cloud server. When I heard it, I thought there were many ways. I could just set up a server and drop the file to download it; I could also use FTP; I could just use remote desktop to drag it down.

Considering the convenience, I feel that the above methods are more troublesome, and it is best to have a direct solution to the problem. Then I found it in Python.

Please see Python3

python -m http.server 8000
Copy after login

Please see Python2

python -m SimpleHTTPServer 8000
Copy after login

In short, a Python command can set up an Http server in the current directory, and then you can download the file. Well, Python is the best language in the world.

The effect is as shown in the picture:

##Related recommendations:

How to build the simplest web server using python

The above is the detailed content of Python's one-click method to build an HTTP server. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template