Posted in Information Technology, Software Engineering

Python simplehttpserver Examples

Simple HTTP server in Python3

To server all HTML files from the current working directory

python3 -m http.server

python3 -m http.server 8080            # for different port
python3 -m http.server 8080 --bind 127.0.0.1    # for secure binding

Simple CGI server in Python3

python3 -m http.server --cgi

Simple HTTP server in Python2

To serve all HTML files from the current working directory

python -m simplehttpserver

Simple CGI server in Python2

python -m CGIHTTPServer

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s