From: Andrew M. Kuchling Date: Thu, 27 Jul 2006 22:49:54 +0000 (+0000) Subject: Add example X-Git-Tag: v2.5b3~122 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fc0e61d9b6f3c77f915fc8b4de287b3f8697e167;p=thirdparty%2FPython%2Fcpython.git Add example --- diff --git a/Doc/lib/libbase64.tex b/Doc/lib/libbase64.tex index 747d8374fc9f..0039c8425018 100644 --- a/Doc/lib/libbase64.tex +++ b/Doc/lib/libbase64.tex @@ -146,6 +146,18 @@ string containing one or more lines of base64-encoded data always including an extra trailing newline (\code{'\e n'}). \end{funcdesc} +An example usage of the module: + +\begin{verbatim} +>>> import base64 +>>> encoded = base64.b64encode('data to be encoded') +>>> encoded +'ZGF0YSB0byBiZSBlbmNvZGVk' +>>> data = base64.b64decode(encoded) +>>> data +'data to be encoded' +\end{verbatim} + \begin{seealso} \seemodule{binascii}{Support module containing \ASCII-to-binary and binary-to-\ASCII{} conversions.}