Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
update documentation links
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Jun 26, 2016
1 parent 86bdf24 commit c587b28
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion _doc/presentation/source/index.rst
Expand Up @@ -216,7 +216,7 @@ ENSAE 1A - Programmation

.. revealjs:: Version de Python

* Le cours est construit pour la version 3.4+.
* Le cours est construit pour la version 3.5+.
* Les exemples ne marcheront pas tous sur la version 2.7.
* Il faut choisir la version *amd64*. C'est la seule capable de tirer parti d'une mémoire de plus de 4 Go.

Expand Down
2 changes: 1 addition & 1 deletion _doc/sphinxdoc/source/i_getting_started.rst
Expand Up @@ -161,7 +161,7 @@ Puis d'écrire ::
Sous Linux ou OS X (Apple), la ligne de commande s'appelle le `terminal <http://doc.ubuntu-fr.org/terminal>`_.
Comme Python est déjà installé en version 2.7, je recommande l'installation de la distribution
Anaconda en version 3.4 qui facilite la coexistence de plusieurs versions de Python. On procède de la même manière ::
Anaconda en version 3.5 qui facilite la coexistence de plusieurs versions de Python. On procède de la même manière ::

cd /home/<alias>/anaconda3/bin
Expand Down
4 changes: 2 additions & 2 deletions _doc/sphinxdoc/source/td_1a.rst
Expand Up @@ -286,12 +286,12 @@ Bibliographie
* `Installer Python pour faire des statistiques <http://www.xavierdupre.fr/blog/2014-02-26_nojs.html>`_
* `Exercices de programmation <http://www.xavierdupre.fr/blog/2014-03-22_nojs.html>`_
* `De l'idée au programme informatique <http://www.xavierdupre.fr/blog/2013-11-08_nojs.html>`_
* `Questions Fréquentes <https://docs.python.org/3.4/faq/index.html>`_
* `Questions Fréquentes <https://docs.python.org/3/faq/index.html>`_
* :ref:`l-FAQ`
* :ref:`l-glossary`
* :ref:`l-questions`
* `Débugger en Python <http://www.xavierdupre.fr/blog/2014-06-02_nojs.html>`_
* `Modules standards <https://docs.python.org/3.4/library/>`_
* `Modules standards <https://docs.python.org/3/library/>`_
* `8 Regular Expressions You Should Know <http://code.tutsplus.com/tutorials/8-regular-expressions-you-should-know--net-6149>`_ *(2016/03)*
* `Love Python <http://love-python.blogspot.fr/>`_ *(2016/03)*
* `The Hitchhiker's Guide to Python! <http://docs.python-guide.org/en/latest/>`_ *(2016/06)*
Expand Down
4 changes: 2 additions & 2 deletions _unittests/ut_automation/test_jenkins.py
Expand Up @@ -117,9 +117,9 @@ def test_jenkins_local(self):

engines = dict(anaconda2="C:\\Anaconda2", anaconda3="C:\\Anaconda3",
winpython="C:\\WinPython-64bit-3.4.2.3\\python-3.4.2.amd64",
default="c:\\Python34_x64",
default="c:\\Python35_x64",
py27="c:\\Python27",
py35="c:\\Python35_x64")
py35="c:\\Python34_x64")

js = JenkinsExt('http://machine:8080/', "user",
"password", mock=True, engines=engines, fLOG=fLOG)
Expand Down
2 changes: 1 addition & 1 deletion src/ensae_teaching_cs/faq/faq_pandas.py
Expand Up @@ -34,7 +34,7 @@ def read_csv(filepath_or_buffer, encoding="utf8", sep="\t", **args):
UnicodeEncodeError: 'charmap' codec can't encode character '\\ufeff' in position 0: character maps to <undefined>
Pour contrecarrer ceci, il suffit de modifier l'encoding par `utf-8-sig <https://docs.python.org/3.4/library/codecs.html#encodings-and-unicode>`_ ::
Pour contrecarrer ceci, il suffit de modifier l'encoding par `utf-8-sig <https://docs.python.org/3/library/codecs.html#encodings-and-unicode>`_ ::
import pandas
df = pandas.read_csv("dataframe.txt",sep="\\t", encoding="utf-8-sig")
Expand Down
38 changes: 19 additions & 19 deletions src/ensae_teaching_cs/faq/faq_python.py
Expand Up @@ -18,7 +18,7 @@ def entier_grande_taille():
La version 3 du langage Python a supprimé la constante ``sys.maxint``
qui définissait l'entier le plus grand (voir
`What's New In Python 3.0 <https://docs.python.org/3.1/whatsnew/3.0.html#integers>`_).
De ce fait la fonction `getrandbit <https://docs.python.org/3.4/library/random.html#random.getrandbits>`_
De ce fait la fonction `getrandbit <https://docs.python.org/3/library/random.html#random.getrandbits>`_
retourne un entier aussi grand que l'on veut.
@code
Expand Down Expand Up @@ -104,7 +104,7 @@ def python_path():
Pour éviter cela, il est possible de dire à l'interpréteur Python d'aller chercher
ailleurs pour trouver des modules en ajoutant le chemin à la
`variable d'environnement <http://fr.wikipedia.org/wiki/Variable_d'environnement>`_
`PYTHON_PATH <https://docs.python.org/3.4/using/cmdline.html#envvar-PYTHONPATH>`_.
`PYTHON_PATH <https://docs.python.org/3/using/cmdline.html#envvar-PYTHONPATH>`_.
Sous Windows :
@code
Expand All @@ -128,7 +128,7 @@ def test_unitaire():
Elle déclenche une exception si elle le code à vérifier ne se comporte pas comme prévu.
Par example, si on voulait écrire un test unitaire pour la fonction
`pow <https://docs.python.org/3.4/library/functions.html#pow>`_, on pourrait
`pow <https://docs.python.org/3/library/functions.html#pow>`_, on pourrait
écrire ::
def test_pow():
Expand Down Expand Up @@ -231,25 +231,25 @@ def same_variable(a, b):
print(a) # --> [-1, 2]
print(b) # --> [1, 2]
La page `Immutable Sequence Types <https://docs.python.org/3.4/library/stdtypes.html?highlight=immutable#immutable-sequence-types>`_
La page `Immutable Sequence Types <https://docs.python.org/3/library/stdtypes.html?highlight=immutable#immutable-sequence-types>`_
détaille un peu plus le type qui sont *mutable* et ceux qui sont *immutable*. Parmi les types standards :
* **mutable**
* `bool <https://docs.python.org/3.4/library/functions.html#bool>`_
* `int <https://docs.python.org/3.4/library/functions.html#int>`_, `float <https://docs.python.org/3.4/library/functions.html#float>`_, `complex <https://docs.python.org/3.4/library/functions.html#complex>`_
* `str <https://docs.python.org/3.4/library/functions.html#func-str>`_, `bytes <https://docs.python.org/3.4/library/functions.html#bytes>`_
* `None <https://docs.python.org/3.4/library/constants.html?highlight=none#None>`_
* `tuple <https://docs.python.org/3.4/library/functions.html#func-tuple>`_, `frozenset <https://docs.python.org/3.4/library/functions.html#func-frozenset>`_
* `bool <https://docs.python.org/3/library/functions.html#bool>`_
* `int <https://docs.python.org/3/library/functions.html#int>`_, `float <https://docs.python.org/3/library/functions.html#float>`_, `complex <https://docs.python.org/3/library/functions.html#complex>`_
* `str <https://docs.python.org/3/library/functions.html#func-str>`_, `bytes <https://docs.python.org/3/library/functions.html#bytes>`_
* `None <https://docs.python.org/3/library/constants.html?highlight=none#None>`_
* `tuple <https://docs.python.org/3/library/functions.html#func-tuple>`_, `frozenset <https://docs.python.org/3/library/functions.html#func-frozenset>`_
* **immutable**, par défaut tous les autres types dont :
* `list <https://docs.python.org/3.4/library/functions.html#func-list>`_
* `dict <https://docs.python.org/3.4/library/functions.html#func-dict>`_
* `set <https://docs.python.org/3.4/library/functions.html#func-set>`_
* `bytearray <https://docs.python.org/3.4/library/functions.html#bytearray>`_
* `list <https://docs.python.org/3/library/functions.html#func-list>`_
* `dict <https://docs.python.org/3/library/functions.html#func-dict>`_
* `set <https://docs.python.org/3/library/functions.html#func-set>`_
* `bytearray <https://docs.python.org/3/library/functions.html#bytearray>`_
Une instance de classe est mutable. Il est possible de la rendre
immutable par quelques astuces :
* `__slots__ <https://docs.python.org/3.4/reference/datamodel.html?highlight=_slots__#object.__slots__>`_
* `__slots__ <https://docs.python.org/3/reference/datamodel.html?highlight=_slots__#object.__slots__>`_
* `How to Create Immutable Classes in Python <http://www.blog.pythonlibrary.org/2014/01/17/how-to-create-immutable-classes-in-python/>`_
* `Ways to make a class immutable in Python <http://stackoverflow.com/questions/4996815/ways-to-make-a-class-immutable-in-python>`_
* `freeze <https://freeze.readthedocs.org/en/latest/>`_
Expand All @@ -275,7 +275,7 @@ def same_variable(a, b):
l1 [0][0] = '##'
print(l1,l2) # --> [['##', 1], [2, 3]] [[0, 1], [2, 3]]
Les deux fonctions s'appliquent à tout object Python : `module copy <https://docs.python.org/3.4/library/copy.html>`_.
Les deux fonctions s'appliquent à tout object Python : `module copy <https://docs.python.org/3/library/copy.html>`_.
@endFAQ
"""
return id(a) == id(b)
Expand Down Expand Up @@ -314,7 +314,7 @@ def processus_quotidien(nom_fichier) :
qui traite les données et la source des données. Le flux lire les données depuis n'importe quel source
(fichier, internet, mémoire), la fonction qui les traite n'a pas besoin d'en connaître la provenance.
`StringIO <https://docs.python.org/3.4/library/io.html#io.StringIO>`_ est un flux qui considère
`StringIO <https://docs.python.org/3/library/io.html#io.StringIO>`_ est un flux qui considère
la mémoire comme source de données.
@code
Expand Down Expand Up @@ -351,7 +351,7 @@ def property_example():
@FAQ(property)
Une `property <https://docs.python.org/3.4/library/functions.html#property>`_ est
Une `property <https://docs.python.org/3/library/functions.html#property>`_ est
une écriture qui sert à transformer l'appel d'une méthode de classe
en un attribut.
Expand Down Expand Up @@ -410,7 +410,7 @@ def enumerate_regex_search(exp, text):
@FAQ(Comment itérer sur les résultats d'une expression régulière ?)
On utilise la méthode `finditer <https://docs.python.org/3.4/library/re.html#re.regex.finditer>`_.
On utilise la méthode `finditer <https://docs.python.org/3/library/re.html#re.regex.finditer>`_.
@code
found = exp.search(text)
Expand Down Expand Up @@ -597,7 +597,7 @@ def information_about_package(name):
Sous Windows, il n'existe pas de compilateur C++ par défaut à moins de l'installer.
Il faut faire attention alors d'utiliser exactement le même que celui utilisé
pour compiler Python (voir
`Compiling Python on Windows <https://docs.python.org/3.4/using/windows.html#compiling-python-on-windows>`_).
`Compiling Python on Windows <https://docs.python.org/3/using/windows.html#compiling-python-on-windows>`_).
C'est pour cela qu'on préfère utiliser des distributions comme
`Anaconda <http://continuum.io/downloads#py34>`_
Expand Down
2 changes: 1 addition & 1 deletion src/ensae_teaching_cs/special/einstein_prolog.py
Expand Up @@ -38,7 +38,7 @@ def permutation(nb):
@warning This method can be very long if nb is high (>10).
This function does something very similar to `itertools.permutations <https://docs.python.org/3.4/library/itertools.html#itertools.permutations>`_.
This function does something very similar to `itertools.permutations <https://docs.python.org/3/library/itertools.html#itertools.permutations>`_.
"""
per = []
p = [i for i in range(0, nb)]
Expand Down
2 changes: 1 addition & 1 deletion src/ensae_teaching_cs/td_1a/classiques.py
Expand Up @@ -242,7 +242,7 @@ def str2date(s, format="%d/%m/%Y"):
@example(Impossible à retenir___conversion d'une chaîne de caractère en date)
C'est le genre de fonction qu'on n'utilise pas souvent mais qu'on peine à retrouver
lorsqu'on en a besoin.
Il faut utiliser la fonction `strftime <https://docs.python.org/3.4/library/datetime.html#strftime-and-strptime-behavior>`_.
Il faut utiliser la fonction `strftime <https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior>`_.
@code
import datetime
Expand Down
8 changes: 4 additions & 4 deletions src/ensae_teaching_cs/td_1a/construction_classique.py
Expand Up @@ -64,7 +64,7 @@ def minindex(li):
@example(Constructions Classiques___minimum avec position)
La fonction `min <https://docs.python.org/3.4/library/functions.html#min>`_
La fonction `min <https://docs.python.org/3/library/functions.html#min>`_
retourne le minium d'un tableau mais pas sa position.
Le premier réflexe est alors de recoder le parcours de la liste
tout en conservant la position du minimum.
Expand Down Expand Up @@ -218,7 +218,7 @@ def somme(li):
s += l # addition
@endcode
Ce code est équivalent à la fonction `sum <https://docs.python.org/3.4/library/functions.html#sum>`_.
Ce code est équivalent à la fonction `sum <https://docs.python.org/3/library/functions.html#sum>`_.
Dans ce cas où la somme intègre le résultat d'une fonction et non les éléments d'une liste,
il faudrait écrire :
Expand Down Expand Up @@ -276,7 +276,7 @@ def triindex(li):
li [i] = ech
@endcode
La fonction `sorted <https://docs.python.org/3.4/library/functions.html#sorted>`_
La fonction `sorted <https://docs.python.org/3/library/functions.html#sorted>`_
trie également une liste mais selon un algorithme plus efficace
que celui-ci (voir `Timsort <http://en.wikipedia.org/wiki/Timsort>`_).
On est parfois amené à reprogrammer un tri parce qu'on veut conserver la position des éléments
Expand Down Expand Up @@ -397,7 +397,7 @@ def mat2vect(mat):
for j in range (0, len (mat [i])) ]
@endcode
Vous pouvez aussi utiliser des fonctions telles `reduce <https://docs.python.org/3.4/library/functools.html?highlight=reduce#module-functools>`_.
Vous pouvez aussi utiliser des fonctions telles `reduce <https://docs.python.org/3/library/functools.html?highlight=reduce#module-functools>`_.
@code
lin = reduce ( lambda x,y: x+y, mat )
Expand Down
2 changes: 1 addition & 1 deletion src/ensae_teaching_cs/td_1a/flask_helper.py
Expand Up @@ -59,7 +59,7 @@ def shutdown(self):
"""
shuts down the server, the function could work if:
* method run keeps a pointer on a server instance
(the one owning method `serve_forever <https://docs.python.org/3.4/library/socketserver.html#socketserver.BaseServer.serve_forever>`_)
(the one owning method `serve_forever <https://docs.python.org/3/library/socketserver.html#socketserver.BaseServer.serve_forever>`_)
* module `werkzeug <http://werkzeug.pocoo.org/>`_ returns this instance
in function `serving.run_simple <https://github.com/mitsuhiko/werkzeug/blob/master/werkzeug/serving.py>`_
* module `Flask <http://flask.pocoo.org/>`_ returns this instance in
Expand Down
2 changes: 1 addition & 1 deletion src/ensae_teaching_cs/td_2a/parallel_thread.py
Expand Up @@ -50,7 +50,7 @@ def parallel(f,
@param list_of_params liste des paramètres
@param nbthread nombre de threads
@param wait attendre pour la fin
@param daemon voir `daemon <https://docs.python.org/3.4/library/threading.html#threading.Thread.daemon>`_
@param daemon voir `daemon <https://docs.python.org/3/library/threading.html#threading.Thread.daemon>`_
@param delay_sec la fonction inclut une boucle qui attend les threads, elle vérifie cela toutes ``delay_sec`` secondes
"""
th = []
Expand Down
2 changes: 1 addition & 1 deletion src/ensae_teaching_cs/td_2a/serialization.py
Expand Up @@ -72,7 +72,7 @@ def dump_object(obj, filename_or_stream):
@endcode
Le code de ces deux fonctions fait intervenir
le module `pickle <https://docs.python.org/3.4/library/pickle.html>`_.
le module `pickle <https://docs.python.org/3/library/pickle.html>`_.
Il suffit pour la plupart des usages.
Pour un usage plus exotique, il faut voir le module
`dill <https://pypi.python.org/pypi/dill>`_.
Expand Down

0 comments on commit c587b28

Please sign in to comment.