cgi.print_form()

cgi.print_form(form) Format a form in HTML.

cgi.print_environ_usage()

cgi.print_environ_usage() Print a list of useful (used by CGI) environment variables in HTML.

cgi.print_environ()

cgi.print_environ() Format the shell environment in HTML.

cgi.print_directory()

cgi.print_directory() Format the current directory in HTML.

cgi.parse_qsl()

cgi.parse_qsl(qs, keep_blank_values=False, strict_parsing=False) This function is deprecated in this module. Use urllib.parse.parse_qsl() instead. It is maintained here only for backward compatibility.

cgi.parse_qs()

cgi.parse_qs(qs, keep_blank_values=False, strict_parsing=False) This function is deprecated in this module. Use urllib.parse.parse_qs() instead. It is maintained here only for backward compatibility.

cgi.parse_multipart()

cgi.parse_multipart(fp, pdict) Parse input of type multipart/form-data (for file uploads). Arguments are fp for the input file and pdict for a dictionary containing other parameters in the Content-Type header. Returns a dictionary just like urllib.parse.parse_qs() keys are the field names, each value is a list of values for that field. This is easy to use but not much good if you are expecting megabytes to be uploaded — in that case, use the FieldStorage class instead which is much more flex

cgi.parse_header()

cgi.parse_header(string) Parse a MIME header (such as Content-Type) into a main value and a dictionary of parameters.

cgi.parse()

cgi.parse(fp=None, environ=os.environ, keep_blank_values=False, strict_parsing=False) Parse a query in the environment or from a file (the file defaults to sys.stdin). The keep_blank_values and strict_parsing parameters are passed to urllib.parse.parse_qs() unchanged.

cgi.FieldStorage.getlist()

FieldStorage.getlist(name) This method always returns a list of values associated with form field name. The method returns an empty list if no such form field or value exists for name. It returns a list consisting of one item if only one such value exists.