Python Base64
Python is a high level general purpose programming language which supports several programming paradigms, including object-oriented, functional, structural, imperative, and aspect-oriented. The main architectural features of Python are dynamic typing, automatic memory management, full introspection, exception handling mechanism, multi-thread computing, and convenient high-level data structures. The standard library includes a bundle of useful functions, including the base64
module that allows encoding and decoding data using several Base64 algorithms.
To encode data to Base64 in Python, use the function base64.b64encode:
from base64 import b64encode
print(b64encode('guru')) #-> 'Z3VydQ=='
And of course, the reverse process — to decode Base64 values use the function base64.b64decode:
from base64 import b64decode
print(b64decode('Z3VydQ==')) #-> 'guru'
Everything is quite simple, but if you are looking for some useful examples, check the following ones:
Comments (33)
I hope you enjoy this discussion. In any case, I ask you to join it.
Thank you for kind words. I'm glad you like it.
c$~$2d2|~|dLO!R5(E#C6c3%PgBn8O0fH0{QO8geB~jv`6{*pvNe-upY649F-C%b^B--Ha>}qyBJKovVdVR#+kwZ