{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "a separate script to store your password / credentials for a system or web source called login_XY\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import keyring\n", "\n", "keyring.set_password('login_XY', 'user_123', 'pass')\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "a second separate script where I need to provide my credentials to login into a system (called login_XY)\n" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'pass'" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import keyring\n", "\n", "keyring.get_password('login_XY', 'user_123')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3.8.5 ('base')", "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.8.5" }, "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "ddf48b7b41de12b424fb83aab9ae5f9d541f6d5d2f7655dfe6d24828b1b45621" } } }, "nbformat": 4, "nbformat_minor": 2 }