1# If Python version returned above is 3.X
2python3 -m http.server
3# On windows try "python" instead of "python3", or "py -3"
4# If Python version returned above is 2.X
5python -m SimpleHTTPServer
1On Ubuntu go to Commands and hit these two commands->
2cd folderName
3python3 -m http.server 8080
1Here 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()