简体   繁体   中英

How Can I open an html file on a local server by using python (python -m http.server)?

When I try to run the following code in the directory where my index.html file is saved:

python -m http.server 8888

I get this error:
This site can't be reachedThe webpage at http://0.0.0.0:8888/index.html might be temporarily down or it may have moved permanently to a new web address.
ERR_ADDRESS_INVALID
How can I solve this issue?
thanks

0.0.0.0 is not a routable address. You put 0.0.0.0 on the command line sometimes to let the server know to listen on any interface. But to route to yourself, you must use the IP address 127.0.0.1.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM