IDE¶
This Project was created with Visual Studio Code and this section help you to setup your VS Code installation for this project.
Install Python¶
Please use the same Version of Python as it used in the Flask Dockerfiles! Right now it is Python 3.8.
Windows 10¶
Note
Change the command Python
to py
when following the instructions!
To enable Python 3 in your Windows 10 Power please follow the article on Digitalocean.com
Linux¶
In moste linux systems python is installed and maintaind out of the box, you just need to check if you use the same version as in in Dockerfiles.
Install Python dependencies¶
Virtualenv¶
If you like, you can install every dependency in a specific folder via virtualenv. To create a virtualenv for the project dependencies.
Virtualenv when Python 3 is the default python interpreter.
$ virtualenv venv
When you want to select a different python version use the param -p
$ virtualenv venv -p python38
To use the virtualenv use the source
command.
$ source venv/bin/activate
Code Format¶
This use Black to format this code, in VS Code you can set on
every save to format the code in black. You can add auto format in black on every save when you add
follow settings in your settings.json
{
"editor.formatOnSave": true,
"python.formatting.provider": "black",
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
}
To install black
use pip
.
For Windows:
$ python -m pip install black
For Mac / Linux:
$ pip install black
To format the code from the terminal you can use the black cli. For example to format the whole project use.
$ black ./