ue_pe_web/scripts/01_intro_python/README.md

1.5 KiB

UE PE serveur web : TP1 Intro Python

Setting up

Let's first initialise a Python environment that is local to this project. The following commands will create a env/ directory containing a local Python installation. The second line will then activate it; our terminal will use the local installation:

Commençons par initialiser un environnement Python local au projet. Les commandes suivantes vont crée un répertoire venv/ qui contiendra une installation Python locale. La deuxième ligne va ensuite l'activer ; notre terminal utilisera alors l'installation locale :

python3 -m venv venv
source venv/bin/activate

We are going to use PDM to package our project. Let's install it with pip:

On va utiliser PDM pour empaqueter notre projet. Installons-le avec pip :

pip install pdm

We can now run the pdm command. We need to install all known dependencies in our development environment:

Nous avons maintenant accès à la commande pdm. Utilisons-la pour installer toutes les dépendances nécessaires dans notre environnement de développement :

pdm install

Building

Now let's build our project just to check that everything is alright:

On peut désormais lancer la commande pdm. Essayons de build notre programme pour être sûr⋅e que tout va bien :

pdm build