Move images to the root folder
continuous-integration/drone/push Build is failing
Details
|
@ -1481,27 +1481,7 @@ system~».
|
|||
\hypertarget{_le_langage_python}{%
|
||||
\section{Le langage Python}\label{_le_langage_python}}
|
||||
|
||||
Le langage \href{https://www.python.org/}{Python} est un
|
||||
\href{https://docs.python.org/3/faq/general.html\#what-is-python}{langage
|
||||
de programmation} interprété, interactif, amusant, orienté objet
|
||||
(souvent), fonctionnel (parfois), open source, multi-plateformes,
|
||||
flexible, facile à apprendre et difficile à maîtriser.
|
||||
|
||||
\begin{figure}
|
||||
\centering
|
||||
\includegraphics{images/xkcd-353-python.png}
|
||||
\caption{\url{https://xkcd.com/353/}}
|
||||
\end{figure}
|
||||
|
||||
A première vue, et suivants les autres langages que vous connaitriez ou
|
||||
auriez déjà abordé, certains concepts restent difficiles à aborder:
|
||||
l'indentation définit l'étendue d'un bloc (classe, fonction, méthode,
|
||||
boucle, condition, \ldots\hspace{0pt}), il n'y a pas de typage fort des
|
||||
variables et le compilateur n'est pas là pour assurer le filet de
|
||||
sécurité avant la mise en production (puisqu'il n'y a pas de compilateur
|
||||
😛). Et malgré ces quelques points, Python reste un langage généraliste
|
||||
accessible et "bon partout", et de pouvoir se reposer sur un écosystème
|
||||
stable et fonctionnel.
|
||||
|
||||
Il fonctionne avec un système d'améliorations basées sur des
|
||||
propositions: les PEP, ou "\textbf{Python Enhancement Proposal}".
|
|
@ -178,7 +178,8 @@ Chaque extrait de code reprendra
|
|||
\item Un surlignage sur les parties importantes ou récemment modifiées
|
||||
\end{itemize}
|
||||
|
||||
La plupart des commandes qui seront présentées dans ce livre le seront
|
||||
depuis un shell sous GNU/Linux. Certaines d'entre elles pourraient
|
||||
devoir être adaptées si vous utilisez un autre système d'exploitation
|
||||
(macOS) ou n'importe quelle autre grosse bouse commerciale.
|
||||
La plupart des commandes qui seront présentées dans ce livre le seront depuis un shell sous GNU/Linux.
|
||||
Certaines d'entre elles pourraient devoir être adaptées si vous utilisez un autre système d'exploitation (macOS) ou n'importe quelle autre grosse bouse commerciale.
|
||||
|
||||
Les morceaux de code que vous trouverez ci-dessous seront développés pour Python3.9+ et Django 3.2+.
|
||||
Ils nécessiteront peut-être quelques adaptations pour fonctionner sur une version antérieure.
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
\chapter{Le langage Python}
|
||||
|
||||
Le langage \href{https://www.python.org/}{Python} est un \href{https://docs.python.org/3/faq/general.html\#what-is-python}{langage de programmation} interprété, interactif, amusant, orienté objet (souvent), fonctionnel (parfois), open source, multi-plateformes, flexible, facile à apprendre et difficile à maîtriser.
|
||||
|
||||
\begin{figure}[!ht]
|
||||
\centering
|
||||
\scalebox{.8}{\includegraphics[max size={\textwidth}{\textheight}]{images/xkcd-353-python.png}}
|
||||
\caption{\url{https://xkcd.com/353/}}
|
||||
\end{figure}
|
||||
|
||||
A première vue, et suivants les autres langages que vous connaitriez ou auriez déjà abordé, certains concepts restent difficiles à aborder: l'indentation définit l'étendue d'un bloc (classe, fonction, méthode, boucle, condition, il n'y a pas de typage fort des variables et le compilateur n'est pas là pour assurer le filet de sécurité avant la mise en production (puisqu'il n'y a pas de compilateur).
|
||||
Et malgré ces quelques points, Python reste un langage généraliste accessible et "bon partout", et de pouvoir se reposer sur un écosystème stable et fonctionnel.
|
||||
|
||||
Il fonctionne avec un système d'améliorations basées sur des propositions: les PEP, ou "\textbf{Python Enhancement Proposal}\index{PEP}".
|
||||
Chacune d'entre elles doit être approuvée par le \href{http://fr.wikipedia.org/wiki/Benevolent_Dictator_for_Life}{Benevolent Dictator For Life\index{BDFL}}.
|
||||
|
||||
Le langage Python utilise un typage dynamique appelé \href{https://fr.wikipedia.org/wiki/Duck_typing}{\textbf{duck typing}}:
|
||||
|
||||
\begin{quote}
|
||||
"\emph{When I see a bird that quacks like a duck, walks like a duck, has
|
||||
feathers and webbed feet and associates with ducks --- I'm certainly
|
||||
going to assume that he is a duck}"
|
||||
|
||||
-- Source: \href{http://en.wikipedia.org/wiki/Duck_test}{Wikipedia}.
|
||||
\end{quote}
|
||||
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 186 KiB After Width: | Height: | Size: 186 KiB |
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 116 KiB |
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 109 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 156 KiB After Width: | Height: | Size: 156 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 172 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 142 KiB |
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 143 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 228 KiB After Width: | Height: | Size: 228 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 139 KiB |
Before Width: | Height: | Size: 145 KiB After Width: | Height: | Size: 145 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 898 KiB After Width: | Height: | Size: 898 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 89 KiB |
4
main.tex
|
@ -7,6 +7,8 @@
|
|||
\usepackage{listing}
|
||||
\usepackage{minted}
|
||||
\usepackage{ulem}
|
||||
\usepackage{graphics}
|
||||
\usepackage[export]{adjustbox}
|
||||
|
||||
\onehalfspacing
|
||||
|
||||
|
@ -40,7 +42,7 @@
|
|||
|
||||
\include{chapters/architecture.tex}
|
||||
|
||||
\chapter{Le langage Python}
|
||||
\include{chapters/python.tex}
|
||||
|
||||
\chapter{Démarrer un nouveau projet}
|
||||
|
||||
|
|