1# If Python version is 3.X
2python3 -m http.server
3
4# If Python version is 2.X
5python -m SimpleHTTPServer
1# Creating a Web server using Python and Flask
2
3from flask import Flask
4
5app = Flask('app')
6@app.route('/')
7
8def run():
9 return '<h1>Hello, Server!</h1>'
10
11app.run(host = '0.0.0.0', port = 8080)
1def run(server_class=HTTPServer, handler_class=S, addr="localhost", port=8000):
2
3 server_address = (addr, port)
4 httpd = server_class(server_address, handler_class)
5 httpd.serve_forever()