---
# System prepended metadata

title: Python

---

# Python

## Conda
Gerenciador de ambientes de python.

Comandos
```
conda env list  // lista os environments
conda activate NOME  // ativa o environment NOME
conda deactivate  // desativa o environment (volta pro base)
conda create --name NOME python=3.10  // cria environment

conda install jupyterlab  // instala uma biblioteca
```

## Jupyter

```
jupyter lab   // abre o notebook no browser em localhost:8888
```

## PDF to text

https://stackoverflow.com/questions/34837707/how-to-extract-text-from-a-pdf-file

```
pip install pypdf
```

```python
from PyPDF2 import PdfReader

reader = PdfReader("example.pdf")
text = ""
for page in reader.pages:
    text += page.extract_text() + "\n"
```