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