#!/usr/bin/python3 # -*- coding: UTF-8 -*-# enable debugging import cgitb, cgi cgitb.enable() print("Content-Type: text/html;charset=utf-8") print() cgi.print_environ() cgi.print_environ_usage()
cgitb.enable() print "Content-Type: text/html" # HTML is following print # blank line, end of headers print "<TITLE>CGI script output</TITLE>" print "<H1>Test</H1>" print "Hello, world!" print "<BR>" form = cgi.FieldStorage() print form print "<BR>" cgi.print_form(form) print "<BR>" v1 = form.getlist('foo') print repr(v1) print "<BR>" cgi.print_environ() print "<BR>" cgi.print_environ_usage() print os.getenv("REMOTE_USER")
#! /usr/local/bin/python3 import cgi import sys import yate print(yate.start_response('text/html')) print(cgi.print_environ()) print('---------------------------------------') print(cgi.print_environ_usage())
def update_event(self, inp=-1): self.set_output_val(0, cgi.print_environ_usage())
import cgi print "Content-Type: text/html" # HTML is following print # blank line, end of headers print "<html>" print "<head>" print "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />" print "<title>CGI script output</title>" print "</head>" print "<body>" print "<H1>這是我的第一個應用程式</H1>" print "哈嚕,大家早安!" print cgi.print_environ() print cgi.print_environ_usage() print "</body>"