cgi
¶
Support module for CGI (Common Gateway Interface) scripts.
This module defines a number of utilities for use by CGI scripts written in Python.
Functions¶
StringIO |
StringIO([s]) – Return a StringIO-like stream for reading or writing |
dolog (fmt, *args) |
Write a log message to the log file. |
escape (s[, quote]) |
Replace special characters “&”, “<” and “>” to HTML-safe sequences. |
filterwarnings (action[, message, category, ...]) |
Insert an entry into the list of warnings filters (at the front). |
initlog (*allargs) |
Write a log message, if there is a log file. |
log (*allargs) |
Write a log message, if there is a log file. |
nolog (*allargs) |
Dummy function, assigned to log when logging is disabled. |
parse ([fp, environ, keep_blank_values, ...]) |
Parse a query in the environment or from a file (default stdin) |
parse_header (line) |
Parse a Content-type like header. |
parse_multipart (fp, pdict) |
Parse multipart input. |
parse_qs (qs[, keep_blank_values, strict_parsing]) |
Parse a query given as a string argument. |
parse_qsl (qs[, keep_blank_values, ...]) |
Parse a query given as a string argument. |
print_arguments () |
|
print_directory () |
Dump the current directory as HTML. |
print_environ ([environ]) |
Dump the shell environment as HTML. |
print_environ_usage () |
Dump a list of environment variables used by CGI as HTML. |
print_exception ([type, value, tb, limit]) |
|
print_form (form) |
Dump the contents of a form as HTML. |
test ([environ]) |
Robust test CGI script, usable as main program. |
valid_boundary (s[, _vb_pattern]) |
|
warn |
Issue a warning, or maybe ignore it or raise an exception. |
Classes¶
FieldStorage ([fp, headers, outerboundary, ...]) |
Store a sequence of fields, reading multipart/form-data. |
FormContent ([environ, keep_blank_values, ...]) |
This class is present for backwards compatibility only. |
FormContentDict ([environ, ...]) |
Form content as dictionary with a list of values per field. |
InterpFormContentDict ([environ, ...]) |
This class is present for backwards compatibility only. |
MiniFieldStorage (name, value) |
Like FieldStorage, for use when no file uploads are possible. |
SvFormContentDict ([environ, ...]) |
Form content as dictionary expecting a single value per field. |
attrgetter |
attrgetter(attr, ...) –> attrgetter object |
catch_warnings ([record, module]) |
A context manager that copies and restores the warnings filter upon exiting the context. |