Newer
Older
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Qu'est-ce que Python ?\n",
"cf. https://fr.wikipedia.org/wiki/Python_(langage)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* Python est un langage de programmation **interprété, multi-paradigme et multiplateformes**"
]
},
{
"cell_type": "code",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'Hello, world!'"
]
},
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\"Hello, world!\""
]
},
{
"cell_type": "code",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'Hello, world!'"
]
},
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\"Hello, \" + \"world!\""
]
},
{
"cell_type": "code",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"3"
]
},
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"1+2"
]
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* Il favorise la **[programmation impérative](https://fr.wikipedia.org/wiki/Programmation_imp%C3%A9rative) [structurée](https://fr.wikipedia.org/wiki/Programmation_structur%C3%A9e), fonctionnelle et orientée objet**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"on verra tout cela..."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* Il est doté d'un \n",
" * d'un **typage dynamique [fort](https://fr.wikipedia.org/wiki/Typage_fort)**,\n",
" "
]
},
{
"cell_type": "code",
"metadata": {},
"outputs": [
{
"ename": "TypeError",
"evalue": "can only concatenate str (not \"int\") to str",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-4-48a28808618d>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;34m\"Hello\"\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m: can only concatenate str (not \"int\") to str"
]
}
],
"source": [
"\"Hello\" + 1"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
" * d'une **gestion automatique de la mémoire par ramasse-miettes** et \n",
" * d'un **système de gestion d'exceptions** ; il est ainsi similaire à Perl, Ruby, Scheme, Smalltalk et Tcl."
]
},
{
"cell_type": "code",
"metadata": {},
"outputs": [
{
"ename": "ZeroDivisionError",
"evalue": "division by zero",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-5-9e1622b385b6>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;36m1\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mZeroDivisionError\u001b[0m: division by zero"
]
}
],
"source": [
"1/0"
]
},
{
"cell_type": "code",
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"division by zero\n"
]
}
],
"source": [
"try:\n",
" 1/0\n",
"except Exception as e:\n",
" print(e)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Un petit peu d'histoire"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* Crée par Guido van Rossum, au \"Centrum voor Wiskunde en Informatica\" d'Amsterdam\n",
"* 20 février 1991 : première version, v. 0.9.0\n",
"* Décembre 2008 : publication de la version 3.0 \n",
"* 24 février 2020 : publication de la version 3.8.2"
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Licence"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\"Python Software Foundation Licence\", cf. https://docs.python.org/3/license.html"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Implémentations du langage\n",
"cf. https://fr.wikipedia.org/wiki/Python_(langage)#Impl%C3%A9mentations_du_langage"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Quelques distributions\n",
"\n",
"* https://www.anaconda.com/distribution/ : multi-plateforme, orientée Data Science\n",
"* https://winpython.github.io/ : portable, pour Windows\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Principales utilisations de Python"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* https://www.quora.com/What-is-the-most-famous-software-written-in-Python"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
}
},
"nbformat": 4,
"nbformat_minor": 2
}