{ "cells": [ { "cell_type": "markdown", "id": "advanced-touch", "metadata": {}, "source": [ "# Python Notebook with No Language Specified\n", "\n", "This Notebook contains various environment variables but will fail to parse because no language is given and no parser variable can be assigned." ] }, { "cell_type": "code", "execution_count": null, "id": "regional-indie", "metadata": {}, "outputs": [], "source": [ "import os\n", "\n", "os.getenv(\"VAR1\")\n", "os.environ[\"VAR2\"]\n", "os.environ.get(\"VAR3\")\n", "\n", "print(os.environ[\"VAR4\"])\n", "print(os.getenv(\"VAR5\", 'localhost'))" ] }, { "cell_type": "code", "execution_count": null, "id": "completed-timothy", "metadata": {}, "outputs": [], "source": [ "os.environ[\"VAR6\"] = \"value6\"\n", "print(os.environ.get(\"VAR7\", 'value7'))\n", "\n", "os.environ[\"VAR1\"] = \"newvalue\"" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "none", "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.9.1" } }, "nbformat": 4, "nbformat_minor": 5 }