Add example

This commit is contained in:
Andrew M. Kuchling 2006-07-27 22:49:38 +00:00
parent 4b6d53780d
commit 752e28ad9f
1 changed files with 14 additions and 0 deletions

View File

@ -158,6 +158,20 @@ want more than one MIME-type database:
\versionadded{2.2}
\end{classdesc}
An example usage of the module:
\begin{verbatim}
>>> import mimetypes
>>> mimetypes.init()
>>> mimetypes.knownfiles
['/etc/mime.types', '/etc/httpd/mime.types', ... ]
>>> mimetypes.suffix_map['.tgz']
'.tar.gz'
>>> mimetypes.encodings_map['.gz']
'gzip'
>>> mimetypes.types_map['.tgz']
'application/x-tar-gz'
\end{verbatim}
\subsection{MimeTypes Objects \label{mimetypes-objects}}