> For the complete documentation index, see [llms.txt](https://mamawhocode.gitbook.io/devops/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mamawhocode.gitbook.io/devops/fundamentals/python.md).

# Python

## pip

Download the [get-pip.py](https://bootstrap.pypa.io/get-pip.py)

```bash
# install pip
sudo python get-pip.py

# check pip
pip freeze
pip freeze | sort | column -t
```

## miniconda

```bash
# create new environment
conda create --name [env_name]

# activate the environment
conda activate [env_name]
```

## Framework

### Flask

#### Start an app

```python
// Some code
sudo sed -i 's/8080/5000/g' app.py; python app.py
```

### Django

### Gunicorn

<details>

<summary>Start app</summary>

```sh
# start python app with 3 workers
# myapp.py
gunicorn -w 3 myapp:app
```

</details>
