How Do I Run a Python Server on Linux?
Contents How Do I Run a Python Server from Terminal? to Run the Server: Open a Terminal Window. Navigate to the Directory You Want to Have the Root Directory...
Contents
How do I run a Python server from terminal?
To run the server:
- Open a terminal window.
- Navigate to the directory you want to have the root directory.
- Execute the command to start the server.
- Python 2 — python -m SimpleHTTPServer 8000.
- Python 3 — python -m http. server 8000.
Must Read
How do I run Python on Linux?
Running a Script
- Open the terminal by searching for it in the dashboard or pressing Ctrl + Alt + T .
- Navigate the terminal to the directory where the script is located using the cd command.
- Type python SCRIPTNAME.py in the terminal to execute the script.