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 :: python divide one column by another 
Python :: python memoization 
Python :: python for property in object 
Python :: variance calculation python manually 
Python :: flask oneid 
Python :: Jupyter notebook: let a user inputs a drawing 
Python :: add a dot in a long number in python 
Python :: python datetime from isoformat 
Python :: python env variable 
Python :: one hot encoder python 
Python :: zermelo python 
Python :: ValueError: logits and labels must have the same shape ((None, 1) vs (None, 2)) 
Python :: plt.imshow not showing 
Python :: print without changing line python 
Python :: python program to give shop name 
Python :: empty dataframe 
Python :: key item loop list python 
Python :: pyhton find dates in weeks 
Python :: python pdf merger 
Python :: how do you create a countdown using turtle python 
Python :: yum install python3 
Python :: filter function using lambda in python 
Python :: hide particular attribute in django admin 
Python :: saving to csv without the index 
Python :: Removing all non-numeric characters from string in Python 
Python :: python list minus list 
Python :: how to average in python with loop 
Python :: pass user to serializer django rest framework 
Python :: pandas open text file 
Python :: greeper 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =