# Python Console et Autocomplétion

**URL:** <https://www.debian-fr.org/t/python-console-et-autocompletion/80241>\
**Category:** Support Debian\
**Created:** [Septembre 23, 2019, 3:43 UTC](https://www.debian-fr.org/t/python-console-et-autocompletion/80241 "2019-09-23T15:43:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![crustyourmind](https://www.debian-fr.org/user_avatar/www.debian-fr.org/crustyourmind/32/2955_2.png) [@crustyourmind](https://www.debian-fr.org/u/crustyourmind)\
**Post date:** [Septembre 23, 2019, 3:43 UTC](https://www.debian-fr.org/t/python-console-et-autocompletion/80241/1 "2019-09-23T15:43:41Z")

</div>

Sous debian sid à jour  
j’ai python d’installé, fonctionnel nickel sauf l’autocomplétion de la console (utilisation via la touche )  
J’ai lu sur le net plusieurs moyen d’y arriver (export d’une variable via bashrc ou profile) ou insertion d’une ligne au début du fichier python  
Quel est le meilleur moyen d’y parvenir ? (le plus propre)  
Merci d’avance 😉  
C

---

<div class="post-metadata">

**Author:** ![Clochette](https://www.debian-fr.org/user_avatar/www.debian-fr.org/clochette/32/8757_2.png) [@Clochette](https://www.debian-fr.org/u/Clochette)\
**Post date:** [Septembre 24, 2019, 11:05 UTC](https://www.debian-fr.org/t/python-console-et-autocompletion/80241/2 "2019-09-24T11:05:31Z")

</div>

> [@crustyourmind](#):
>
> j’ai python d’installé, fonctionnel nickel sauf l’autocomplétion de la console

Tu peux détailler ton souci ?

---

<div class="post-metadata">

**Author:** ![crustyourmind](https://www.debian-fr.org/user_avatar/www.debian-fr.org/crustyourmind/32/2955_2.png) [@crustyourmind](https://www.debian-fr.org/u/crustyourmind)\
**Post date:** [Septembre 24, 2019, 6:15 UTC](https://www.debian-fr.org/t/python-console-et-autocompletion/80241/3 "2019-09-24T18:15:52Z")

</div>

Hello,  
Alors sous freeBSD quand je fais de l’autocomplétion voilà ce que ça donne :

```
[ragnarok@asgard-freeBSD:~] $ python3.6
Python 3.6.9 (default, Jul 9 2019, 01:18:18) 
[GCC 4.2.1 Compatible FreeBSD Clang 6.0.1 (tags/RELEASE_601/final 335540)] on freebsd12
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> math
math
>>> math.
math.acos( math.erf( math.inf math.pi
math.acosh( math.erfc( math.isclose( math.pow(
math.asin( math.exp( math.isfinite( math.radians(
math.asinh( math.expm1( math.isinf( math.sin(
math.atan( math.fabs( math.isnan( math.sinh(
math.atan2( math.factorial( math.ldexp( math.sqrt(
math.atanh( math.floor( math.lgamma( math.tan(
math.ceil( math.fmod( math.log( math.tanh(
math.copysign( math.frexp( math.log10( math.tau
math.cos( math.fsum( math.log1p( math.trunc(
math.cosh( math.gamma( math.log2(       
math.degrees( math.gcd( math.modf(       
math.e math.hypot( math.nan   

```

C’est à dire que l’appui sur la touche mais donne toutes les possibilités.  
par exemple si je tape **_objet._** , il me propose toutes les méthodes associées à cet objet

Sous ma SID, j’ai 2 versions de python, ça fonctionne nickel dans une console python version 3.7 par contre l’autocomplétion ne passe pas sous python 2.7…

En fait par trop grave, vu que c’est la version 3 qui m’intéresse, mais j’aurais aimé comprendre le pourquoi du comment…

Merci 😉

---

<div class="post-metadata">

**Author:** ![flavien](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/f/f475e1/32.png) [@flavien](https://www.debian-fr.org/u/flavien)\
**Post date:** [Septembre 25, 2019, 5:35 UTC](https://www.debian-fr.org/t/python-console-et-autocompletion/80241/4 "2019-09-25T05:35:35Z")

</div>

Chalut,

C’est tout simplement une fonctionnalité de python 3.4 (cf. [https://docs.python.org/3/whatsnew/3.4.html#sys](https://docs.python.org/3/whatsnew/3.4.html#sys) 2ème paragraphe).  
La première réponse fournie ici ([https://stackoverflow.com/questions/246725/how-do-i-add-tab-completion-to-the-python-shell](https://stackoverflow.com/questions/246725/how-do-i-add-tab-completion-to-the-python-shell)) explique sa mise en place pour les versions inférieures.

---

<div class="post-metadata">

**Author:** ![crustyourmind](https://www.debian-fr.org/user_avatar/www.debian-fr.org/crustyourmind/32/2955_2.png) [@crustyourmind](https://www.debian-fr.org/u/crustyourmind)\
**Post date:** [Septembre 25, 2019, 8:42 UTC](https://www.debian-fr.org/t/python-console-et-autocompletion/80241/5 "2019-09-25T08:42:01Z")

</div>

OK merci pour ces précisions 🙂
