Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

convert file to base64 python

import base64
data = open("sample.txt", "r").read()
encoded = base64.b64encode(data)
Comment

fiel to base64 python

import base64

with open("yourfile.ext", "rb") as image_file:
    encoded_string = base64.b64encode(image_file.read())
Comment

PREVIOUS NEXT
Code Example
Python :: How to Create a Pie Chart in Seaborn 
Python :: codeforces 677a python solution 
Python :: python temporaty files 
Python :: import stopwords 
Python :: get the last element of a list python 
Python :: python bcrypt 
Python :: python truncate to integer 
Python :: linux command on python 
Python :: how to make a crosshair in python 
Python :: plotly hide trace from hover 
Python :: sqlalchemy validation 
Python :: python iterate over object fields 
Python :: python dataframe get numeric columns 
Python :: dot product python 
Python :: get values using iloc 
Python :: python timedelta 
Python :: dataframe split column 
Python :: creating virtual environment python 
Python :: how to know where python is installed on windows 
Python :: sort by dataframe 
Python :: numpy set_printoptions 
Python :: jupyter notebook change default directory 
Python :: how to show webcam in opencv 
Python :: find nth root of m using python 
Python :: how to import subprocess in python 
Python :: get string between two characters python 
Python :: printing with format float to 2 decimal places python 
Python :: how to find the cube of a number in python 
Python :: pickle.load python 
Python :: python GOOGLE_APPLICATION_CREDENTIALS 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =