From 28b1116be66ba4f1a3d4dbffa33a9927a695e5c3 Mon Sep 17 00:00:00 2001 From: Dimitri Merejkowsky Date: Thu, 2 May 2019 11:17:01 +0200 Subject: [PATCH] Update python-11.md --- sessions/python-11.md | 44 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 sessions/python-11.md diff --git a/sessions/python-11.md b/sessions/python-11.md new file mode 100644 index 0000000..b885162 --- /dev/null +++ b/sessions/python-11.md @@ -0,0 +1,44 @@ +% Programmation avec Python (chapitre 11) +% Dimitri Merejkowsky + +\center \huge Retour sur les exceptions + +# A quoi sert finally + +```python +try: + fp = open("file.txt") + 1 / 0 +except ZeroDivisionError: + print("got you") +finally: + print("closing") + fp.close() +``` + +Que se passe-t-il si on remplace `1/0` par +`my_list[42]` ? + +\center \huge Libraries tierces + +# Introduction: pip + +* python3 -m pip +* `--user` + +But: what about several projects? + +# Virtualenvs + +# pip + virtualenv = <3 + +# Tuto + +* Let's install requests! + +``` +# avant + +# après +``` +