Try python to build your own web server

In the python3 environment, you can use the python3 -m http.server + port number command to build your own static web server . The -m command is to run the modules in the package. At this time, you have to open the terminal in the directory where you put the files To execute the command, I opened the terminal under the following path:
Insert picture description here

If you don’t write the port, it will open on port 8000 by default
as follows:
Insert picture description here
At this time, you can see that the service has been opened on port 8000. At this time, you can open the browser to check whether your web site has started successfully, because I only put an index.html Page, so take this html as an example, visit your own web site and you can see:
Insert picture description here
Check my html file at this time: it
Insert picture description here
can be proved that we have started successfully

Guess you like

Origin blog.csdn.net/weixin_48445640/article/details/108900281