What does the 'python3 -m http.server 8000' command do?

The command python3 -m http.server 8000 starts a simple HTTP server using Python's built-in http.server module. Here's a breakdown of the command:

  • python3: This invokes the Python 3 interpreter.
  • -m http.server: This option tells Python to run the http.server module as a script.
  • 8000: This specifies the port number on which the server will listen for incoming HTTP requests.

When you run this command, it sets up a web server that serves files from the current directory over HTTP on port 8000. You can access it by navigating to http://localhost:8000 in a web browser.

0 Comments

no data
Be the first to share your comment!