1
0
Fork 0
python-docs-fr/tutorial/interpreter.po

293 lines
14 KiB
Plaintext
Raw Normal View History

2018-07-04 09:06:45 +00:00
# Copyright (C) 2001-2018, Python Software Foundation
2018-07-04 09:08:42 +00:00
# For licence information, see README file.
2016-10-30 09:46:26 +00:00
#
msgid ""
msgstr ""
2019-12-05 22:15:54 +00:00
"Project-Id-Version: Python 3\n"
2016-10-30 09:46:26 +00:00
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-01-15 22:33+0100\n"
"PO-Revision-Date: 2023-02-04 14:39+0100\n"
2020-09-30 12:44:08 +00:00
"Last-Translator: Jules Lasne <jules.lasne@gmail.com>\n"
2018-07-04 09:14:25 +00:00
"Language-Team: FRENCH <traductions@lists.afpy.org>\n"
2017-05-16 21:31:05 +00:00
"Language: fr\n"
2017-05-27 17:46:38 +00:00
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.2.1\n"
2016-10-30 09:46:26 +00:00
#: tutorial/interpreter.rst:5
2016-10-30 09:46:26 +00:00
msgid "Using the Python Interpreter"
2018-01-30 22:09:10 +00:00
msgstr "Mode d'emploi de l'interpréteur Python"
2016-10-30 09:46:26 +00:00
#: tutorial/interpreter.rst:11
2016-10-30 09:46:26 +00:00
msgid "Invoking the Interpreter"
2018-01-30 22:09:10 +00:00
msgstr "Lancement de l'interpréteur"
2016-10-30 09:46:26 +00:00
#: tutorial/interpreter.rst:13
2016-10-30 09:46:26 +00:00
msgid ""
"The Python interpreter is usually installed as :file:`/usr/local/bin/"
2022-03-23 17:40:12 +00:00
"python3.11` on those machines where it is available; putting :file:`/usr/"
2016-10-30 09:46:26 +00:00
"local/bin` in your Unix shell's search path makes it possible to start it by "
"typing the command:"
msgstr ""
"En général, vous trouvez l'interpréteur Python sous :file:`/usr/local/bin/"
"python3.11` sur les machines où il est disponible ; ajoutez :file:`/usr/"
"local/bin` au chemin de recherche de votre shell Unix afin de pouvoir le "
"lancer en tapant la commande :"
2016-10-30 09:46:26 +00:00
#: tutorial/interpreter.rst:21
2016-10-30 09:46:26 +00:00
msgid ""
"to the shell. [#]_ Since the choice of the directory where the interpreter "
"lives is an installation option, other places are possible; check with your "
"local Python guru or system administrator. (E.g., :file:`/usr/local/python` "
"is a popular alternative location.)"
msgstr ""
"dans le shell. [#]_ Le choix du répertoire où se trouve l'interpréteur étant "
"une option d'installation, d'autres chemins sont possibles ; voyez avec "
2018-01-30 22:09:10 +00:00
"votre gourou Python local ou votre administrateur système (par exemple, :"
"file:`/usr/local/python` est un endroit courant)."
2016-10-30 09:46:26 +00:00
#: tutorial/interpreter.rst:26
2016-10-30 09:46:26 +00:00
msgid ""
"On Windows machines where you have installed Python from the :ref:`Microsoft "
2022-03-23 17:40:12 +00:00
"Store <windows-store>`, the :file:`python3.11` command will be available. If "
"you have the :ref:`py.exe launcher <launcher>` installed, you can use the :"
"file:`py` command. See :ref:`setting-envvars` for other ways to launch "
"Python."
2016-10-30 09:46:26 +00:00
msgstr ""
"Sur les machines Windows sur lesquelles vous avez installé Python à partir "
"du :ref:`Microsoft Store <windows-store>`, la commande :file:`python3.11` "
"est disponible. Si le :ref:`lanceur py.exe <launcher>` est installé, vous "
"pouvez utiliser la commande :file:`py`. Voir :ref:`setting-envvars` pour "
"d'autres façons de lancer Python."
2016-10-30 09:46:26 +00:00
#: tutorial/interpreter.rst:31
2016-10-30 09:46:26 +00:00
msgid ""
"Typing an end-of-file character (:kbd:`Control-D` on Unix, :kbd:`Control-Z` "
"on Windows) at the primary prompt causes the interpreter to exit with a zero "
"exit status. If that doesn't work, you can exit the interpreter by typing "
"the following command: ``quit()``."
msgstr ""
2018-01-30 22:09:10 +00:00
"Tapez un caractère de fin de fichier (:kbd:`Ctrl-D` sous Unix, :kbd:`Ctrl-Z` "
"sous Windows) dans une invite de commande primaire provoque la fermeture de "
"l'interpréteur avec un code de sortie nul. Si cela ne fonctionne pas, vous "
"pouvez fermer l'interpréteur en tapant la commande ``quit()``."
2016-10-30 09:46:26 +00:00
#: tutorial/interpreter.rst:36
2016-10-30 09:46:26 +00:00
msgid ""
"The interpreter's line-editing features include interactive editing, history "
2019-10-09 16:10:12 +00:00
"substitution and code completion on systems that support the `GNU Readline "
"<https://tiswww.case.edu/php/chet/readline/rltop.html>`_ library. Perhaps "
2016-10-30 09:46:26 +00:00
"the quickest check to see whether command line editing is supported is "
"typing :kbd:`Control-P` to the first Python prompt you get. If it beeps, "
"you have command line editing; see Appendix :ref:`tut-interacting` for an "
"introduction to the keys. If nothing appears to happen, or if ``^P`` is "
"echoed, command line editing isn't available; you'll only be able to use "
"backspace to remove characters from the current line."
msgstr ""
"Les fonctionnalités d'édition de l'interpréteur comprennent l'édition "
2018-01-30 22:09:10 +00:00
"interactive, la substitution depuis l'historique et la complétion sur les "
"systèmes qui gèrent la bibliothèque `GNU Readline <https://tiswww.case.edu/"
"php/chet/readline/rltop.html>`_. Un moyen rapide de tester comment est gérée "
2018-01-30 22:09:10 +00:00
"l'édition de la ligne de commande, c'est de taper :kbd:`Control-P` à la "
"première invite de commande que vous rencontrez. Si cela bipe, vous disposez "
"de l'édition de la ligne de commande ; lisez l'appendice :ref:`tut-"
2016-10-30 09:46:26 +00:00
"interacting` pour une introduction aux touches. Si rien ne semble se "
"produire ou si ``^P`` s'affiche, l'édition de la ligne de commande n'est pas "
"disponible ; vous serez seulement en mesure d'utiliser la touche retour "
2016-10-30 09:46:26 +00:00
"arrière pour supprimer des caractères de la ligne courante."
#: tutorial/interpreter.rst:46
2016-10-30 09:46:26 +00:00
msgid ""
"The interpreter operates somewhat like the Unix shell: when called with "
"standard input connected to a tty device, it reads and executes commands "
"interactively; when called with a file name argument or with a file as "
"standard input, it reads and executes a *script* from that file."
msgstr ""
"L'interpréteur fonctionne de façon similaire au shell Unix : lorsqu'il est "
2018-01-30 22:09:10 +00:00
"appelé avec l'entrée standard connectée à un périphérique tty, il lit et "
"exécute les commandes de façon interactive ; lorsqu'il est appelé avec un "
2018-01-30 22:09:10 +00:00
"nom de fichier en argument ou avec un fichier comme entrée standard, il lit "
"et exécute un *script* depuis ce fichier."
2016-10-30 09:46:26 +00:00
#: tutorial/interpreter.rst:51
2016-10-30 09:46:26 +00:00
msgid ""
"A second way of starting the interpreter is ``python -c command [arg] ...``, "
"which executes the statement(s) in *command*, analogous to the shell's :"
"option:`-c` option. Since Python statements often contain spaces or other "
"characters that are special to the shell, it is usually advised to quote "
"*command* in its entirety."
2016-10-30 09:46:26 +00:00
msgstr ""
"Une autre façon de lancer l'interpréteur est ``python -c commande [arg] ..."
"``. Cela exécute les instructions de *commande* de façon analogue à "
"l'option :option:`-c` du shell. Parce que les instructions Python "
"contiennent souvent des espaces et d'autres caractères spéciaux pour le "
"shell, il est généralement conseillé de mettre *commande* entre guillemets "
"simples."
#: tutorial/interpreter.rst:57
2016-10-30 09:46:26 +00:00
msgid ""
"Some Python modules are also useful as scripts. These can be invoked using "
"``python -m module [arg] ...``, which executes the source file for *module* "
"as if you had spelled out its full name on the command line."
msgstr ""
"Certains modules Python sont aussi utiles en tant que scripts. Ils peuvent "
2018-01-30 22:09:10 +00:00
"être appelés avec ``python -m module [arg] ...`` qui exécute le fichier "
2016-10-30 09:46:26 +00:00
"source de *module* comme si vous aviez tapé son nom complet dans la ligne de "
"commande."
#: tutorial/interpreter.rst:61
2016-10-30 09:46:26 +00:00
msgid ""
"When a script file is used, it is sometimes useful to be able to run the "
"script and enter interactive mode afterwards. This can be done by passing :"
"option:`-i` before the script."
msgstr ""
"Quand un fichier de script est utilisé, il est parfois utile de pouvoir "
"lancer le script puis d'entrer dans le mode interactif après coup. Cela est "
"possible en passant :option:`-i` avant le script."
#: tutorial/interpreter.rst:65
2016-10-30 09:46:26 +00:00
msgid "All command line options are described in :ref:`using-on-general`."
msgstr ""
"Tous les paramètres utilisables en ligne de commande sont documentés dans :"
"ref:`using-on-general`."
#: tutorial/interpreter.rst:71
2016-10-30 09:46:26 +00:00
msgid "Argument Passing"
msgstr "Passage d'arguments"
#: tutorial/interpreter.rst:73
2016-10-30 09:46:26 +00:00
msgid ""
"When known to the interpreter, the script name and additional arguments "
"thereafter are turned into a list of strings and assigned to the ``argv`` "
"variable in the ``sys`` module. You can access this list by executing "
"``import sys``. The length of the list is at least one; when no script and "
"no arguments are given, ``sys.argv[0]`` is an empty string. When the script "
"name is given as ``'-'`` (meaning standard input), ``sys.argv[0]`` is set "
"to ``'-'``. When :option:`-c` *command* is used, ``sys.argv[0]`` is set to "
"``'-c'``. When :option:`-m` *module* is used, ``sys.argv[0]`` is set to "
"the full name of the located module. Options found after :option:`-c` "
"*command* or :option:`-m` *module* are not consumed by the Python "
"interpreter's option processing but left in ``sys.argv`` for the command or "
"module to handle."
msgstr ""
"Lorsqu'ils sont connus de l'interpréteur, le nom du script et les arguments "
"additionnels sont représentés sous forme d'une liste assignée à la variable "
"``argv`` du module ``sys``. Vous pouvez y accéder en exécutant ``import "
"sys``. La liste contient au minimum un élément ; quand aucun script ni aucun "
2018-01-30 22:14:12 +00:00
"argument n'est donné, ``sys.argv[0]`` est une chaine vide. Quand ``'-'`` "
2016-10-30 09:46:26 +00:00
"(qui représente l'entrée standard) est passé comme nom de script, ``sys."
"argv[0]`` contient ``'-'``. Quand :option:`-c` *commande* est utilisé, ``sys."
"argv[0]`` contient ``'-c'``. Enfin, quand :option:`-m` *module* est utilisé, "
"le nom complet du module est assigné à ``sys.argv[0]``. Les options trouvées "
"après :option:`-c` *commande* ou :option:`-m` *module* ne sont pas lues "
"comme options de l'interpréteur Python mais laissées dans ``sys.argv`` pour "
2018-01-30 22:09:10 +00:00
"être utilisées par le module ou la commande."
2016-10-30 09:46:26 +00:00
#: tutorial/interpreter.rst:89
2016-10-30 09:46:26 +00:00
msgid "Interactive Mode"
msgstr "Mode interactif"
#: tutorial/interpreter.rst:91
2016-10-30 09:46:26 +00:00
msgid ""
"When commands are read from a tty, the interpreter is said to be in "
"*interactive mode*. In this mode it prompts for the next command with the "
"*primary prompt*, usually three greater-than signs (``>>>``); for "
"continuation lines it prompts with the *secondary prompt*, by default three "
"dots (``...``). The interpreter prints a welcome message stating its version "
"number and a copyright notice before printing the first prompt:"
msgstr ""
"Lorsque des commandes sont lues depuis un tty, l'interpréteur est dit être "
"en *mode interactif*. Dans ce mode, il demande la commande suivante avec le "
"*prompt primaire*, en général trois signes plus-grand-que (``>>>``) ; pour "
"les lignes de continuation, il affiche le *prompt secondaire*, par défaut "
"trois points (``...``). L'interpréteur affiche un message de bienvenue "
"indiquant son numéro de version et une notice de copyright avant d'afficher "
"le premier prompt :"
2016-10-30 09:46:26 +00:00
#: tutorial/interpreter.rst:108
2016-10-30 09:46:26 +00:00
msgid ""
"Continuation lines are needed when entering a multi-line construct. As an "
"example, take a look at this :keyword:`if` statement::"
msgstr ""
"Les lignes de continuation sont nécessaires pour entrer une construction "
"multi-lignes. Par exemple, regardez cette instruction :keyword:`if` ::"
2016-10-30 09:46:26 +00:00
#: tutorial/interpreter.rst:118
2016-10-30 09:46:26 +00:00
msgid "For more on interactive mode, see :ref:`tut-interac`."
msgstr ""
"Pour plus d'informations sur le mode interactif, voir :ref:`tut-interac`."
#: tutorial/interpreter.rst:124
2016-10-30 09:46:26 +00:00
msgid "The Interpreter and Its Environment"
msgstr "L'interpréteur et son environnement"
#: tutorial/interpreter.rst:130
2016-10-30 09:46:26 +00:00
msgid "Source Code Encoding"
msgstr "Encodage du code source"
#: tutorial/interpreter.rst:132
2016-10-30 09:46:26 +00:00
msgid ""
"By default, Python source files are treated as encoded in UTF-8. In that "
"encoding, characters of most languages in the world can be used "
"simultaneously in string literals, identifiers and comments --- although the "
"standard library only uses ASCII characters for identifiers, a convention "
"that any portable code should follow. To display all these characters "
"properly, your editor must recognize that the file is UTF-8, and it must use "
"a font that supports all the characters in the file."
msgstr ""
2018-01-30 22:09:10 +00:00
"Par défaut, Python considère que ses fichiers sources sont encodés en UTF-8. "
2016-10-30 09:46:26 +00:00
"Dans cet encodage, les caractères de la plupart des langues peuvent être "
"utilisés à la fois dans les chaînes de caractères, identifiants et "
2018-01-30 22:09:10 +00:00
"commentaires. Notez que la bibliothèque standard n'utilise que des "
"caractères ASCII dans ses identifiants et que nous considérons que c'est une "
"bonne habitude que tout code portable devrait suivre. Pour afficher "
"correctement tous ces caractères, votre éditeur doit reconnaître que le "
"fichier est en UTF-8 et utiliser une police qui comprend tous les caractères "
"utilisés dans le fichier."
2016-10-30 09:46:26 +00:00
#: tutorial/interpreter.rst:140
2016-10-30 09:46:26 +00:00
msgid ""
2017-04-02 20:14:06 +00:00
"To declare an encoding other than the default one, a special comment line "
"should be added as the *first* line of the file. The syntax is as follows::"
2016-10-30 09:46:26 +00:00
msgstr ""
2017-05-16 21:31:05 +00:00
"Pour annoncer un encodage différent de l'encodage par défaut, une ligne de "
2018-01-30 22:09:10 +00:00
"commentaire particulière doit être ajoutée en tant que *première* ligne du "
"fichier. Sa syntaxe est la suivante ::"
2016-10-30 09:46:26 +00:00
#: tutorial/interpreter.rst:145
2017-04-02 20:14:06 +00:00
msgid "where *encoding* is one of the valid :mod:`codecs` supported by Python."
msgstr "où *encoding* est un des :mod:`codecs` géré par Python."
2016-10-30 09:46:26 +00:00
#: tutorial/interpreter.rst:147
2016-10-30 09:46:26 +00:00
msgid ""
2017-04-02 20:14:06 +00:00
"For example, to declare that Windows-1252 encoding is to be used, the first "
"line of your source code file should be::"
2016-10-30 09:46:26 +00:00
msgstr ""
2018-01-30 22:09:10 +00:00
"Par exemple, pour déclarer un encodage *Windows-1252*, la première ligne de "
"votre code source doit être ::"
2016-10-30 09:46:26 +00:00
#: tutorial/interpreter.rst:152
2016-10-30 09:46:26 +00:00
msgid ""
2017-04-02 20:14:06 +00:00
"One exception to the *first line* rule is when the source code starts with "
"a :ref:`UNIX \"shebang\" line <tut-scripts>`. In this case, the encoding "
"declaration should be added as the second line of the file. For example::"
2016-10-30 09:46:26 +00:00
msgstr ""
2017-05-16 21:31:05 +00:00
"Une exception à la règle *première ligne* est lorsque la première ligne est "
2018-01-30 22:09:10 +00:00
"un :ref:`shebang UNIX <tut-scripts>`. Dans ce cas, la déclaration de "
"l'encodage doit être placée sur la deuxième ligne du fichier. Par exemple ::"
2016-10-30 09:46:26 +00:00
#: tutorial/interpreter.rst:160
2016-10-30 09:46:26 +00:00
msgid "Footnotes"
msgstr "Notes"
#: tutorial/interpreter.rst:161
2016-10-30 09:46:26 +00:00
msgid ""
"On Unix, the Python 3.x interpreter is by default not installed with the "
"executable named ``python``, so that it does not conflict with a "
"simultaneously installed Python 2.x executable."
msgstr ""
2018-01-30 22:09:10 +00:00
"Sous Unix, par défaut, l'interpréteur Python 3.x n'est pas installé sous le "
"nom de ``python`` afin de ne pas entrer en conflit avec une éventuelle "
2016-10-30 09:46:26 +00:00
"installation de Python 2.x."