requirements : ipython notebook
[davin.git] / ateliers / debian-python-virtualenv / mtlpy-workshop-debian-dev-env-fr.ipynb
CommitLineData
ddc640e6
DB
1{
2 "metadata": {
3 "name": "mtlpy-workshop-debian-dev-env-fr"
4 },
5 "nbformat": 3,
6 "nbformat_minor": 0,
7 "worksheets": [
8 {
9 "cells": [
10 {
11 "cell_type": "markdown",
12 "metadata": {},
13 "source": [
14 "# Debian + Python = \u2661\n",
15 "\n",
16 "## Pr\u00e9requis\n",
17 "\n",
18 "* Debian install\u00e9e\n",
19 "\n",
20 "## Python\n",
21 "\n",
22 "* Lancer un terminal<pre>\n",
23 "$\n",
24 "</pre>\n",
25 "\n",
26 "* Lancer Python<pre>\n",
27 "$ python\n",
28 "</pre>\n",
29 "\n",
30 "* Identifier la version par d\u00e9faut de Python<pre>\n",
31 "$ python\n",
32 "Python 2.7.3 (default, Jan 2 2013, 16:53:07) \n",
33 "[GCC 4.7.2] on linux2\n",
34 "Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n",
35 "<<<\n",
36 "</pre>\n",
37 "\n",
38 "* Coder un truc<pre>\n",
39 "<<< print \"Hello World!\"\n",
40 "Hello World!\n",
41 "</pre>\n",
42 "\n",
43 "* Dans la vraie vie on \u00e9crit des scripts... donc il faut installer un \u00e9diteur de texte\n",
44 "\n",
45 "## Debian : installer un paquet Debian\n",
46 "\n",
47 "Comment trouver un paquet\n",
48 "\n",
49 "* Web : tous les paquets : [http://packages.debian.org/stable/allpackages](http://packages.debian.org/fr/stable/allpackages)\n",
50 "* Web : tous les paquets par cat\u00e9gorie : [http://packages.debian.org/stable/](http://packages.debian.org/fr/stable/)\n",
51 "* Web : paquets Python : [http://packages.debian.org/stable/python/](http://packages.debian.org/en/stable/python/)\n",
52 "\n",
53 "Comment installer (et supprimer) un paquet\n",
54 "\n",
55 "* Mode graphique : o\u00f9 aller<pre>\n",
56 "Applications > Outils syst\u00e8me > Ajouter/supprimer des logiciels\n",
57 "</pre>\n",
58 "* Ligne de commande : voici la commande<br />\n",
59 "(remplacer \"package-name\" avec le nom du paquet que vous voulez installer/supprimer)<pre>\n",
60 "$ sudo apt-get install package-name\n",
61 "$ sudo apt-get remove package-name\n",
62 "</pre>\n",
63 "\n",
64 "Paquets install\u00e9s au niveau syst\u00e8me (system-wide) vs install\u00e9s au niveau projet (project-wide)\n",
65 "\n",
66 "* Niveau syst\u00e8me : pour tous les projets, pourrait n\u00e9cessiter \"sudo\"\n",
67 "* Niveau projet : propre au projet, permet utilisation d'une version sp\u00e9cifique\n",
68 "\n",
69 "## \u00c9diteur texte\n",
70 "\n",
71 "[http://packages.debian.org/stable/editors/](http://packages.debian.org/stable/editors/)\n",
72 "\n",
73 "* Mode graphique : gedit est d\u00e9j\u00e0 l\u00e0\n",
74 "* Ligne de commande : emacs, vim, nano\n",
75 "* Quel choisir? une question de go\u00fbt\n",
76 "* Paquets Debian = \n",
77 "<pre>\n",
78 "$ sudo apt-get install emacs\n",
79 "$ sudo apt-get install vim\n",
80 "$ sudo apt-get install nano\n",
81 "</pre>\n",
82 "\n",
83 "## Python : interpr\u00e9teur Python\n",
84 "\n",
85 "* IPython : interpr\u00e9teur interactif<br />\n",
86 "pourquoi IPython?\n",
87 "* IPython notebook : pourrait \u00eatre utile pour les ateliers de Montr\u00e9al-Python ;)\n",
88 "* Paquets Debian = \n",
89 "<pre>\n",
90 "$ sudo apt-get install ipython\n",
91 "$ sudo apt-get install ipython-notebook\n",
92 "</pre>\n",
93 "\n",
94 "## Gestion des versions\n",
95 "\n",
96 "* Pourquoi g\u00e9rer les versions du code source?\n",
97 "* Quel choisir? git, mercurial...\n",
98 "* Paquets Debian = \n",
99 "<pre>\n",
100 "$ sudo apt-get install git\n",
101 "$ sudo apt-get install gitk\n",
102 "$ sudo apt-get install mercurial\n",
103 "</pre>\n",
104 "\n",
105 "## Extensions Python\n",
106 "\n",
107 "* Les extensions Python \u00e9crites dans d'autres langages pourraient \u00eatre n\u00e9cessaires, donc il nous faut des outils pour pouvoir les compiler<br />\n",
108 "ex.: gcc, pil...\n",
109 "* build-essentials, python-dev (sources de Python)\n",
110 "* Paquets Debian = \n",
111 "<pre>\n",
112 "$ sudo apt-get install build-essential\n",
113 "$ sudo apt-get install python-dev\n",
114 "</pre>\n",
115 "\n",
116 "## Environnements virtuels\n",
117 "\n",
118 "* Pour que les paquets soient install\u00e9s au niveau projet\n",
119 "* virtualenv\n",
120 "* Paquet Debian = \n",
121 "<pre>\n",
122 "$ sudo apt-get install python-virtualenv\n",
123 "</pre>\n",
124 "\n",
125 "## Outils Python offerts en paquet Debian\n",
126 "\n",
127 "Science\n",
128 "\n",
129 "* matplotlib, numpy\n",
130 "* Pour quoi?\n",
131 "* Paquets Debian =\n",
132 "<pre>\n",
133 "$ sudo apt-get install python-matplotlib\n",
134 "$ sudo apt-get install python-numpy\n",
135 "</pre>\n",
136 "\n",
137 "Frameworks web\n",
138 "\n",
139 "* Django, Pyramid\n",
140 "* Pour quoi? Quel choisir?\n",
141 "* Paquets Debian =\n",
142 "<pre>\n",
143 "$ sudo apt-get install python-django\n",
144 "$ sudo apt-get install python-pyramid\n",
145 "</pre>\n",
146 "\n",
147 "pilotes de base de donn\u00e9es\n",
148 "\n",
149 "* mysqldb, psycopg, sqlalchemy\n",
150 "* Pour quoi? Quel choisir?\n",
151 "* Paquets Debian =\n",
152 "<pre>\n",
153 "$ sudo apt-get install python-mysqldb\n",
154 "$ sudo apt-get install python-psycopg2\n",
155 "$ sudo apt-get install python-sqlalchemy\n",
156 "</pre>\n",
157 "\n",
158 "## Conclusion\n",
159 "\n",
160 "Eh bien...\n",
161 "\n",
162 "* Pas besoin de grand chose\n",
163 "* Tout est l\u00e0 dans Debian\n",
164 "* C'est simple et l'fun!\n",
165 "\n",
166 "## En suite?\n",
167 "\n",
168 "Nous sommes l\u00e0 pour aider \u00e0 l'installation et l'exploration de tout \u00e7a.\n",
169 "\n",
170 "Montr\u00e9al-Python : \u00e9v\u00e9nements \u00e0 venir.\n",
171 "\n",
172 "* MP 37, conf\u00e9rence mensuelle de MP : [http://montrealpython.org/2013/04/mp37/](http://montrealpython.org/2013/04/mp37/)\n",
173 "* Ateliers? Intro \u00e0 Python, Intro \u00e0 Django, autre?\n",
174 "* PyCon 2014 : \u00e0 Montr\u00e9al\n",
175 "\n",
176 "Suivez nous\n",
177 "\n",
178 "* [http://montrealpython.org](http://montrealpython.org)\n",
179 "* Voir contacts : liste de discussion, IRC, twitter\n",
180 "* Facebook : [https://www.facebook.com/montrealpython](https://www.facebook.com/montrealpython)\n"
181 ]
182 }
183 ],
184 "metadata": {}
185 }
186 ]
187}