I'm new to Python and CGI, so this may be trivial. But I'd like Python to produce a block of HTML whenever a visitor loads a page.
<html>
<body>
<!-- Beautiful website with great content -->
<!-- Suddenly... -->
<h1> Here's Some Python Output </h1>
<!-- RUN PYTHON SCRIPT, display output -->
</body>
</html>
Using a Python script that, for simplicity, looks something like this:
#!/usr/bin/python
print "Content-type: text/html"
print
print "<p>Hello world!</p>"
Most resources I was able to find demonstrate how to produce an ENTIRE webpage using a Python script. Can you invoke a Python script mid-page to produce JUST an HTML snippet?