.. index:: pair: Action ; 2019-02-15 pair: Gestion de projet ; framagit pair: Installation ; pipenv pair: Module ; ipython pair: Module ; sympy pair: Documentation ; sphinx .. _2019_02_15: ========================================================================================== Vendredi 15 Février 2019 : démo Python 3.7, ipython sphinx, sympy, framagit pour Ethan ========================================================================================== .. seealso:: - https://www.python.org - https://www.python.org/success-stories/ - https://framasoft.org/fr/ - https://docs.python.org/fr/3.7/ - https://pvergain.frama.io/stages_python/index.html .. contents:: :depth: 3 Plan ======= Utilisation de: - pipenv_ (installation des modules Python) - ipython_ (utilisation de la ligne de commande) - sympy_ (mathématiques) - sphinx_ (documentation des projets) - framagit_ (gestion de projet + production documentation) .. _framagit: https://framagit.org .. _sympy: https://docs.sympy.org/latest/index.html .. _pipenv: https://github.com/pypa/pipenv .. _ipython: https://github.com/ipython/ipython .. _sphinx: https://github.com/sphinx-doc/sphinx ipython ========= :: pipenv install ipython sympy ====== :: pipenv install sympy :: projet_ethan) pvergain@UC004 > ~/projects/projet_ethan > pipenv install sympy :: Installing sympy… Adding sympy to Pipfile's [packages]… ✔ Installation Succeeded Pipfile.lock (57cde4) out of date, updating to (c8fa08)… Locking [dev-packages] dependencies… Locking [packages] dependencies… ✔ Success! Updated Pipfile.lock (57cde4)! Installing dependencies from Pipfile.lock (57cde4)… 🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 16/16 — :: (projet_ethan) pvergain@UC004 ~/projects/projet_ethan > ipython :: Python 3.7.2 (default, Jan 28 2019, 08:35:57) Type 'copyright', 'credits' or 'license' for more information IPython 7.2.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: from sympy.plotting import plot In [2]: from sympy import Symbol In [4]: x=Symbol('x') In [6]: plot(2*x+3) 22.2727 | ... | .. | .... | ... | ... | ... | ... | ... 2.63636 | ---------------------------...------------------------- | .. | .... | ... | ... | .. | .... | .. | ... -17 | .... -10 0 10 Out[6]: Module python test.py ======================= .. code-block:: python :linenos: from sympy.plotting import plot from sympy import Symbol x=Symbol('x') plot(2*x+3) :: (projet_ethan) ✘ pvergain@UC004 > ~/projects/projet_ethan > python test.py :: 22.2727 | ... | .. | .... | ... | ... | ... | ... | ... 2.63636 | ---------------------------...------------------------- | .. | .... | ... | ... | .. | .... | .. | ... -17 | .... -10 0 10 gitlab ======= gitlab board ------------- .. figure:: gitlab_board.png :align: center https://framagit.org/pvergain/stages_python/boards Production de la documentation --------------------------------- Après un *git commit*, la documentation est produite par le gitlab de framasoft pour produire la documentation ici: https://pvergain.frama.io/stages_python/index.html :: --- # .gitlab-ci.yml # =============== # # https://gitlab.com/help/user/project/pages/getting_started_part_four.md # Creating and Tweaking GitLab CI/CD for GitLab Pages # https://store.docker.com/images/python image: python:3.7-alpine pages: stage: deploy script: - pip install --upgrade pip - pip install -r requirements.txt - sphinx-build -d _build/doctrees . _build/html - mv _build/html public artifacts: paths: - public only: - master Question d'Ethan =================== Quelles sont les applications de Python ? ---------------------------------------------- Python est employé dans de très nombreux domaines: - domaine scientifique (analyse de données, machine learning...) - développement web (Django, Flask, ...) - etc... Voir: - https://www.python.org/success-stories/ - https://news.codecademy.com/why-learn-python/ - https://www.pluralsight.com/blog/software-development/ask-3-why-learn-python - https://realpython.com/world-class-companies-using-python/