From: Andrew M. Kuchling Date: Thu, 27 Jul 2006 22:49:38 +0000 (+0000) Subject: Add example X-Git-Tag: v2.5b3~123 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=752e28ad9fabd20907a55ae4a8846fdb4a977624;p=python Add example --- diff --git a/Doc/lib/libmimetypes.tex b/Doc/lib/libmimetypes.tex index 8e07768f75..6c46d6f2b4 100644 --- a/Doc/lib/libmimetypes.tex +++ b/Doc/lib/libmimetypes.tex @@ -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}}