python run server
python3 -m http.server 8000 # LINUX
python -m http.server 8000 # WINDOWS
python run server
python3 -m http.server 8000 # LINUX
python -m http.server 8000 # WINDOWS
start a simple http server python3
python3 -m http.server 8000
python local server command
On Ubuntu go to Commands and hit these two commands->
cd folderName
python3 -m http.server 8080
server on python
import http.server
import socketserver
PORT = 8000
Handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(("", PORT), Handler) as httpd:
print("serving at port", PORT)
httpd.serve_forever()
start python server
python -m http.server --directory /tmp/
run server python
Here is all the code:import osfrom http.server import HTTPServer, CGIHTTPRequestHandler# Make sure the server is created at current directoryos.chdir('.')# Create server object listening the port 80server_object = HTTPServer(server_address=('', 80), RequestHandlerClass=CGIHTTPRequestHandler)# Start the web serverserver_object.serve_forever()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us