Python3 SimpleHTTPServer | Python SimpleHTTPServer

昝涛
2023-12-01

Python’s SimpleHTTPServer module is a handy and straightforward tool that developers can use for several use-cases, with the main one being that it’s a quick way to serve files from the directory. It removes the laborious process associated with installing and implementing the available cross-platform web servers.

If you are using Python 2, then you can use the following command.

$ python -m SimpleHTTPServer 8000

If you are using Python 3, then you can use the following command

$ python3 -m http.server 8000

The server provides a simple directory UI in which you can access any of the files. This is the simplest way to serve files locally over HTTP directly.

Python provides us with the SimpleHTTPServer module (or http.server in Python 3) that can be used to quickly and efficiently serve files from a local directory via HTTP. This can be used for many developments or other internal tasks but is not meant for production.

 类似资料:

相关阅读

相关文章

相关问答