What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-10 14:42:04
download csv file from jupyter notebook
import base64 import pandas as pd from IPython.display import HTML def create_download_link( df, title = "Download CSV file", filename = "data.csv"): csv = df.to_csv() b64 = base64.b64encode(csv.encode()) payload = b64.dec... Add solution -
Python 2021-09-30 03:43:05
python send image in post request with json data
import base64 import json import requests api = 'http://localhost:8080/test' image_file = 'sample_image.png' with open(image_file, "rb") as f: im_bytes = f.read() im_b64 = base64.b64encode(im_bytes).decode(&quo... Add solution -
Python 2021-09-29 19:45:04
hide password in python
#https://docs.python.org/3/library/base64.html >>> import base64 >>> print(base64.b64encode("password".encode("utf-8"))) cGFzc3dvcmQ= >>> print(base64.b64decode("cGFzc3dvcmQ=").decode("utf-8&... Add solution -
Python 2021-09-22 00:13:02
json to base64 python
>>> import json >>> import base64 >>> d = {"alg": "ES256"} >>> s = json.dumps(d) # Turns your json dict into a str >>> print(s) {"alg": "ES256"} >>> type(s) &l... Add solution
Best helpers
Ranking is empty