Topics


Pages


Content

See cgi in the Python 3 docs.

Place .py file in cgi-bin or htbin folder.

Make the file executable.

$ chmod +x filename.py

Run CGI server

$ python3 -m http.server

Open in the browser:

  • http://localhost:8000/cgi-bin/test.py

Or use:

$ python3 -m webbrowser -t "http://localhost:8000/cgi-bin/test.py"