Python has excellent support for CGI scripts.


Using the built-in cgi module, you can read query parameters and POST bodies, and process file uploads. This is enough for small scripts or single-purpose pages. If you want to build a whole web application, you should look into a web framework like

import cgi

print('Content-Type: text/plain\n')
form = cgi.FieldStorage()

name = form.getvalue('name') or 'World'
print(f'Hello, {name}!')

Bottle is a microframework that’s used outside CGI as well. It allows you to create your applications in higher-level logic.