{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Environments\n", "\n", "\n", "There are two main types of environments that you need to consider when developing code in Python.\n", "The `bash` environment which knows about the shell and your OS, and the `python` environment which knows about the python packages you are using.\n", "\n", "\n", "## Bash environment\n", "\n", "The bash environment is defined by a set of environment variables. \n", "\n", "### Environment variables\n", "\n", "It is a key-value pair, stored by the OS, used by programs and shell scripts to configure the system behavior. \n", "\n", "The key is the variable name, and the value is the variable value.\n", "\n", "To set an environment variable, you can use the `export` command. For example:\n", "\n", "```bash\n", "export MY_VARIABLE=\"my_value\"\n", "```\n", "\n", "To print the value of an environment variable, you can use the `echo` command. For example:\n", "\n", "```bash\n", "echo $MY_VARIABLE\n", "```\n", "\n", "with the dollar sign `$` to get the value of the variable (think of dollar/value).\n", "\n", "You can list the environment variables currently set in your bash session by typing:\n", "\n", "```bash\n", "printenv\n", "```\n", "\n", "This is a bash command that is **very important**, you should not forget about it.\n", "\n", "\n", "