fork download
  1. import cgi
  2.  
  3. # Print Content-Type header
  4. print("Content-Type: text/html\n")
  5.  
  6. # Create HTML content
  7. print("<html>")
  8. print("<head>")
  9. print("<title>CGI Example</title>")
  10. print("</head>")
  11. print("<body>")
  12. print("<h1>CGI Example</h1>")
  13. print("<p>This is a simple CGI script written in Python.</p>")
  14. print("</body>")
  15. print("</html>")
Success #stdin #stdout 0.05s 12652KB
stdin
Standard input is empty
stdout
Content-Type: text/html

<html>
<head>
<title>CGI Example</title>
</head>
<body>
<h1>CGI Example</h1>
<p>This is a simple CGI script written in Python.</p>
</body>
</html>