c# .net Adsense ADO.NET Linq Viruses/security asp.net MVC JQuery Angular-js Node-js SEO Java C++ SQL API Networking vb.net .Net Css JavaScript Generics c#.Net entity framework HTML Website host Website Construction Guide HTTP tutorial W3C tutorial Web Services JSON Psychology Ionic framework Angular ReactJS Python Computer Android
Python

How to Encode & Decode using Base64 in Python?

| | python
In this video I will show you how to encode and decode using Base64 in Python.
CODE:
import base64
my_string = "This is my text document.."
encoded_str = base64.b64encode(my_string.encode('ascii'))
print(f"Encoded string: { encoded_str }")

mystr_decoded = base64.b64decode(encoded_str.decode('ascii'))
print(f"Decoded string: { mystr_decoded }")

Output:

Encode Decode in python