]> granicus.if.org Git - python/commitdiff
Add example
authorAndrew M. Kuchling <amk@amk.ca>
Thu, 27 Jul 2006 22:49:54 +0000 (22:49 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Thu, 27 Jul 2006 22:49:54 +0000 (22:49 +0000)
Doc/lib/libbase64.tex

index 747d8374fc9fc2d3698f1f0dfa18d09c48f15858..0039c8425018a5acdbbebde0bdade33253d93321 100644 (file)
@@ -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.}