{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "81ff91ce53ae83fe", "metadata": { "ExecuteTime": { "end_time": "2025-07-10T07:07:50.829656Z", "start_time": "2025-07-10T07:07:50.824248Z" } }, "outputs": [], "source": [ "import base64" ] }, { "cell_type": "code", "execution_count": null, "id": "initial_id", "metadata": { "ExecuteTime": { "end_time": "2025-07-10T07:08:19.010102Z", "start_time": "2025-07-10T07:08:19.004314Z" }, "collapsed": true }, "outputs": [], "source": [ "with open(\"examples/cancer_example.jpg\", \"rb\") as f:\n", " encoded = base64.b64encode(f.read()).decode()" ] }, { "cell_type": "code", "execution_count": null, "id": "35cac43020ae6db3", "metadata": { "ExecuteTime": { "end_time": "2025-07-10T07:08:35.977343Z", "start_time": "2025-07-10T07:08:35.973715Z" } }, "outputs": [], "source": [ "print(encoded)" ] } ], "metadata": { "kernelspec": { "display_name": "3.12.2", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.2" } }, "nbformat": 4, "nbformat_minor": 5 }