
Python Programming Base64 Encoding Decoding Code Example
In order to do base64 encoding and decoding in Python Programming, make use of the base64 package,
Code Example:"""
Base 64 Encoding Decoding in
Python Programming
Author: Code2care.org
Date: 03-Apr-2022
Version: 1.0
"""
import base64
plan_text_string = 'Hello there! Python'
# Base64 Encoding Code Example
base64_encoded_string_result = base64.b64encode(plan_text_string.encode('utf-8'))
print(base64_encoded_string_result)
# Base64 Decoding Code Example
base64_encoded_string = 'SGVsbG8gdGhlcmUhIFB5dGhvbg=='
base64_decoded_string_result = base64.b64decode(base64_encoded_string).decode('utf-8')
print(base64_decoded_string_result)
Output:
b'SGVsbG8gdGhlcmUhIFB5dGhvbg=='
Hello there! Python
More Posts related to Python,
- How to add two float numbers in Python
- tkinter - Hello World! Program
- Convert Float to String in Python
- ModuleNotFoundError: No module named qdarkstyle.colorsystem [Python]
- How to List all Packages installed using pip [Python]
- Check if String Contains a Substring - Python
- Change label (text) color in tkinter
- Where does brew install python in macOS
- Validate email address in Python using regular expression (regex)
- How to uninstall pip Python packages
- ModuleNotFoundError: No module named qdarkstyle.colorsystem [Python]
- Python: Fix command not found pip or pip3 on zsh shell
- Check version of pip package installer for Python
- 3 Python program to add two numbers
- Calculate discount amount python code
- How to add borders to tkinter label text
- How to install Python 3.9 using brew on Mac
- Python Program To Calculate Simple Interest (SimpleInterest.py)
- Comments in Python Programming
- What is Terminal Velocity and its Formula? How to calculate it programmatically?
- How to take user input from the console in a Python program
- Install and Run Jupyter Notebook on Mac (macOS)
- Tkinter - add x and y padding to label text
- 7 Python Arithmetic Operators with Examples [Tutorial]
- Python Sleep Function/Method Code Example
More Posts:
- Where is .zshrc file located in macOS - MacOS
- How to change Android Titlebar theme color from Purple - Android
- How to display date and time in GMT Timezone in Java - Java
- List of Eclipse versions and future releases (2020-09) - Eclipse
- Android RatingBar Example - Android
- Outlook and Hotmail not working - email issue, message not delivered, send receive problem - Microsoft
- How to add Date and Time to Windows Notepad File - NotepadPlusPlus
- SharePoint update append Required Field to display name of mandatory columns - SharePoint