Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

base64 encode python

import base64

message = "Python is fun"
message_bytes = message.encode('ascii')
base64_bytes = base64.b64encode(message_bytes)
base64_message = base64_bytes.decode('ascii')

print(base64_message)
Comment

base64 decode python

>>> import base64
>>> encoded = base64.b64encode(b'data to be encoded')
>>> encoded
b'ZGF0YSB0byBiZSBlbmNvZGVk'
>>> data = base64.b64decode(encoded)
>>> data
b'data to be encoded'
Comment

base64 decode python

import base64
plain_str = 'SGVsbG8gV29ybGQ='
bytes_repr = bytes(plain_str, encoding='utf-8')
decoded_string = base64.b64decode(bytes_repr)
message = str(decoded_string, encoding='utf-8')

print(message)
Comment

decode base64 python

import base64
msg = base64.b64decode(msg)
Comment

decode base64 with python

#== Decoding ==#

import base64

base64_message = 'UHl0aG9uIGlzIGZ1bg=='
base64_bytes = base64_message.encode('ascii')
message_bytes = base64.b64decode(base64_bytes)
message = message_bytes.decode('ascii')

print(message)
Comment

base64 python decode

import base64
coded_string = '''Q5YACgA...'''
base64.b64decode(coded_string)
Comment

PREVIOUS NEXT
Code Example
Python :: python calc days between dates 
Python :: python screen recorder 
Python :: display full dataframe pandas 
Python :: matplotlib legend 
Python :: how to apply logarithm in pandas dataframe 
Python :: python url encoding 
Python :: change value in pandas dataframe cell 
Python :: run unittest in terminal python 
Python :: selenium python switch to iframe 
Python :: how to separate string in python by blank line 
Python :: How to find least common multiple of two numbers in Python 
Python :: python open file exception 
Python :: python get webpage source 
Python :: get the number of today week python 
Python :: python extract every nth value from list 
Python :: colab tqdm import 
Python :: python month number from date 
Python :: how to find and replace all the punctuation in python strings 
Python :: matplotlib x axis at the top 
Python :: ctrl c selenium python 
Python :: pyspark find columns with null values 
Python :: zipfile python 
Python :: python datetime now only date 
Python :: area of a circle in python 
Python :: mp4 to wav python 
Python :: python - save file 
Python :: input stdout python 
Python :: keyboard listener python 
Python :: python save figure as pdf 
Python :: python list add if not present 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =