I am learning how to use VS code and in the process, I learnt about linting and formatting with "pylint"
and "black"
respectively.
Importantly, I have Anaconda installed as I often use conda environments for my different projects. I have therefore installed "pylint"
and "black"
into my conda environment.
My questions are as follows:
- If
"pylint"
and"black"
are Python packages, why do they not need to be imported into your script when you use them? (i.e."import pylint"
and"import black"
at the top of a Python script you want to run). I am very new to VS code, linting and formatting so maybe I'm missing something obvious but how does VS code know what to do when I select "Run Linting" or "Format document" in the command palette? Or is this nothing to do with VS code ?
I guess I am just suprised at the fact we don't need to import these packages to use them. In contrast you would always be using import for other packages (sys, os, or any other).
- I'm assuming if I used a different conda environment, I then need to install pylint and black again in it right?