# Copyright (C) 2001-2020, Python Software Foundation # This file is distributed under the same license as the Python package. # Maintained by the python-doc-es workteam. # docs-es@python.org / # https://mail.python.org/mailman3/lists/docs-es.python.org/ # Check https://github.com/python/python-docs-es/blob/3.8/TRANSLATORS to # get the list of volunteers # msgid "" msgstr "" "Project-Id-Version: Python 3.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-10-12 19:43+0200\n" "PO-Revision-Date: 2023-11-02 12:44+0100\n" "Last-Translator: Marcos Medrano \n" "Language-Team: python-doc-es\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "Generated-By: Babel 2.13.0\n" "X-Generator: Poedit 3.4\n" #: ../Doc/library/code.rst:2 msgid ":mod:`code` --- Interpreter base classes" msgstr ":mod:`code` --- Clases básicas de intérpretes" #: ../Doc/library/code.rst:7 msgid "**Source code:** :source:`Lib/code.py`" msgstr "**Código fuente::** :source:`Lib/code.py`" #: ../Doc/library/code.rst:11 msgid "" "The ``code`` module provides facilities to implement read-eval-print loops " "in Python. Two classes and convenience functions are included which can be " "used to build applications which provide an interactive interpreter prompt." msgstr "" "El módulo de ``code`` proporciona facilidades para implementar bucles de " "lectura-evaluación-impresión en Python. Se incluyen dos clases y funciones " "de conveniencia que se pueden usar para crear aplicaciones que brinden un " "*prompt* interactivo del intérprete." #: ../Doc/library/code.rst:18 msgid "" "This class deals with parsing and interpreter state (the user's namespace); " "it does not deal with input buffering or prompting or input file naming (the " "filename is always passed in explicitly). The optional *locals* argument " "specifies the dictionary in which code will be executed; it defaults to a " "newly created dictionary with key ``'__name__'`` set to ``'__console__'`` " "and key ``'__doc__'`` set to ``None``." msgstr "" "Esta clase se ocupa del estado del intérprete y del análisis sintáctico (el " "espacio de nombres del usuario); no se ocupa del almacenamiento en búfer de " "entrada o de la solicitud o la denominación de archivos de entrada (el " "nombre de archivo siempre se pasa explícitamente). El argumento opcional " "*locals* especifica el diccionario en el que se ejecutará el código; por " "defecto es un diccionario recién creado con la clave ``'__name __'`` " "establecida en ``'__console __'`` y la clave ``'__doc __'`` en ``None``." #: ../Doc/library/code.rst:28 msgid "" "Closely emulate the behavior of the interactive Python interpreter. This " "class builds on :class:`InteractiveInterpreter` and adds prompting using the " "familiar ``sys.ps1`` and ``sys.ps2``, and input buffering." msgstr "" "Emula estrictamente el comportamiento del intérprete interactivo de Python. " "Esta clase se basa en :class:`InteractiveInterpreter` y agrega solicitudes y " "búfer de entrada usando los conocidos ``sys.ps1`` y ``sys.ps2``." #: ../Doc/library/code.rst:35 msgid "" "Convenience function to run a read-eval-print loop. This creates a new " "instance of :class:`InteractiveConsole` and sets *readfunc* to be used as " "the :meth:`InteractiveConsole.raw_input` method, if provided. If *local* is " "provided, it is passed to the :class:`InteractiveConsole` constructor for " "use as the default namespace for the interpreter loop. The :meth:`interact` " "method of the instance is then run with *banner* and *exitmsg* passed as the " "banner and exit message to use, if provided. The console object is " "discarded after use." msgstr "" "Función de conveniencia para ejecutar un ciclo de lectura-evaluación-" "impresión (*read-eval-print*). Esto crea una nueva instancia de :class:" "`InteractiveConsole` y establece *readfunc* -si se proporciona- para ser " "utilizado como el método :meth:`InteractiveConsole.raw_input`. Si se " "proporciona *local*, se pasa al constructor :class:`InteractiveConsole` para " "usarlo como el espacio de nombres predeterminado para el bucle del " "intérprete. El método :meth:`interact` de la instancia se ejecuta con " "*banner* y *exitmsg*, estos se pasan como bandera y mensaje de salida para " "usar nuevamente, si se proporciona. El objeto de la consola se descarta " "después de su uso." #: ../Doc/library/code.rst:44 msgid "Added *exitmsg* parameter." msgstr "Se agregó el parámetro *exitmsg*." #: ../Doc/library/code.rst:50 msgid "" "This function is useful for programs that want to emulate Python's " "interpreter main loop (a.k.a. the read-eval-print loop). The tricky part is " "to determine when the user has entered an incomplete command that can be " "completed by entering more text (as opposed to a complete command or a " "syntax error). This function *almost* always makes the same decision as the " "real interpreter main loop." msgstr "" "Esta función es útil para programas que desean emular el bucle principal del " "intérprete de Python (también conocido como bucle *read-eval-print*). La " "parte complicada es determinar cuándo el usuario ha ingresado un comando " "incompleto que se puede completar ingresando más texto (en lugar de un " "comando completo o un error de sintaxis). Esta función *casi* siempre toma " "la misma decisión que el bucle principal del intérprete real." #: ../Doc/library/code.rst:57 msgid "" "*source* is the source string; *filename* is the optional filename from " "which source was read, defaulting to ``''``; and *symbol* is the " "optional grammar start symbol, which should be ``'single'`` (the default), " "``'eval'`` or ``'exec'``." msgstr "" "*source* es la cadena de caracteres fuente; *filename* es el nombre de " "archivo opcional desde el que se leyó la fuente, por defecto es " "``''``; y *symbol* es el símbolo de inicio gramatical opcional, que " "debería ser ``'single'`` (el predeterminado), ``'eval'`` o ``'exec'``." #: ../Doc/library/code.rst:62 msgid "" "Returns a code object (the same as ``compile(source, filename, symbol)``) if " "the command is complete and valid; ``None`` if the command is incomplete; " "raises :exc:`SyntaxError` if the command is complete and contains a syntax " "error, or raises :exc:`OverflowError` or :exc:`ValueError` if the command " "contains an invalid literal." msgstr "" "Retorna un objeto de código (lo mismo que ``compile(source, filename, " "symbol)``) si el comando está completo y es válido; ``None`` si el comando " "está incompleto; lanza :exc:`SyntaxError` si el comando está completo y " "contiene un error de sintaxis, o lanza :exc:`OverflowError` o :exc:" "`ValueError` si el comando contiene un literal no válido." #: ../Doc/library/code.rst:72 msgid "Interactive Interpreter Objects" msgstr "Objetos de intérprete interactivo" #: ../Doc/library/code.rst:77 msgid "" "Compile and run some source in the interpreter. Arguments are the same as " "for :func:`compile_command`; the default for *filename* is ``''``, " "and for *symbol* is ``'single'``. One of several things can happen:" msgstr "" "Compila y ejecuta alguna fuente en el intérprete. Los argumentos son los " "mismos que para :func:`compile_command`; el valor predeterminado para " "*filename* es ``''``, y para *symbol* es ``'single'``. Puede suceder " "una de varias cosas:" #: ../Doc/library/code.rst:81 msgid "" "The input is incorrect; :func:`compile_command` raised an exception (:exc:" "`SyntaxError` or :exc:`OverflowError`). A syntax traceback will be printed " "by calling the :meth:`showsyntaxerror` method. :meth:`runsource` returns " "``False``." msgstr "" "La entrada es incorrecta; :func:`compile_command` generó una excepción (:exc:" "`SyntaxError` o :exc:`OverflowError`). Se imprime un seguimiento de sintaxis " "llamando al método :meth:`showsyntaxerror`. :meth:`runsource` retorna " "``False``." #: ../Doc/library/code.rst:86 msgid "" "The input is incomplete, and more input is required; :func:`compile_command` " "returned ``None``. :meth:`runsource` returns ``True``." msgstr "" "La entrada está incompleta y se requiere más información; :func:" "`compile_command` retorna ``None``. :meth:`runsource` retorna ``True``." #: ../Doc/library/code.rst:89 msgid "" "The input is complete; :func:`compile_command` returned a code object. The " "code is executed by calling the :meth:`runcode` (which also handles run-time " "exceptions, except for :exc:`SystemExit`). :meth:`runsource` returns " "``False``." msgstr "" "La entrada está completa; :func:`compile_command` retornó un objeto de " "código. El código se ejecuta llamando a :meth:`runcode` (que también maneja " "excepciones en tiempo de ejecución, excepto :exc:`SystemExit`). :meth:" "`runsource` retorna ``False``." #: ../Doc/library/code.rst:93 msgid "" "The return value can be used to decide whether to use ``sys.ps1`` or ``sys." "ps2`` to prompt the next line." msgstr "" "El valor de retorno se puede usar para decidir si usar ``sys.ps1`` o ``sys." "ps2`` para solicitar la siguiente línea." #: ../Doc/library/code.rst:99 msgid "" "Execute a code object. When an exception occurs, :meth:`showtraceback` is " "called to display a traceback. All exceptions are caught except :exc:" "`SystemExit`, which is allowed to propagate." msgstr "" "Ejecuta un objeto de código. Cuando ocurre una excepción, se llama a :meth:" "`showtraceback` para mostrar un seguimiento del código. Se capturan todas " "las excepciones excepto :exc:`SystemExit`, que puede propagarse." #: ../Doc/library/code.rst:103 msgid "" "A note about :exc:`KeyboardInterrupt`: this exception may occur elsewhere in " "this code, and may not always be caught. The caller should be prepared to " "deal with it." msgstr "" "Una nota sobre :exc:`KeyboardInterrupt`: esta excepción puede ocurrir en " "otra parte de este código y no siempre se detecta. Quien llama la función " "debe estar preparado para manejar esto." #: ../Doc/library/code.rst:110 msgid "" "Display the syntax error that just occurred. This does not display a stack " "trace because there isn't one for syntax errors. If *filename* is given, it " "is stuffed into the exception instead of the default filename provided by " "Python's parser, because it always uses ``''`` when reading from a " "string. The output is written by the :meth:`write` method." msgstr "" "Muestra el error de sintaxis que acaba de ocurrir. Esto no muestra la traza " "de seguimiento porque no la hay para errores de sintaxis. Si se proporciona " "*filename*, se incluirá en la excepción en lugar del nombre de archivo " "predeterminado proporcionado por el analizador de Python, ya que siempre usa " "``''`` cuando lee de una cadena de caracteres. La salida se escribe " "mediante el método :meth:`write`." #: ../Doc/library/code.rst:119 msgid "" "Display the exception that just occurred. We remove the first stack item " "because it is within the interpreter object implementation. The output is " "written by the :meth:`write` method." msgstr "" "Muestra la excepción que acaba de ocurrir. Eliminamos el primer elemento de " "la pila porque está dentro de la implementación del intérprete. La salida se " "escribe mediante el método :meth:`write`." #: ../Doc/library/code.rst:123 msgid "" "The full chained traceback is displayed instead of just the primary " "traceback." msgstr "" "Se muestra la traza de seguimiento encadenada completa en lugar de solo la " "traza primaria de pila." #: ../Doc/library/code.rst:129 msgid "" "Write a string to the standard error stream (``sys.stderr``). Derived " "classes should override this to provide the appropriate output handling as " "needed." msgstr "" "Escribe una cadena de caracteres en el flujo de error estándar (``sys." "stderr``). Las clases derivadas deben reemplazar esto para proporcionar el " "manejo de salida apropiado según sea necesario." #: ../Doc/library/code.rst:136 msgid "Interactive Console Objects" msgstr "Objetos de consola interactiva" #: ../Doc/library/code.rst:138 msgid "" "The :class:`InteractiveConsole` class is a subclass of :class:" "`InteractiveInterpreter`, and so offers all the methods of the interpreter " "objects as well as the following additions." msgstr "" "La clase :class:`InteractiveConsole` es una subclase de :class:" "`InteractiveInterpreter`, por lo que ofrece todos los métodos de los objetos " "del intérprete, así como las siguientes adiciones." #: ../Doc/library/code.rst:145 msgid "" "Closely emulate the interactive Python console. The optional *banner* " "argument specify the banner to print before the first interaction; by " "default it prints a banner similar to the one printed by the standard Python " "interpreter, followed by the class name of the console object in parentheses " "(so as not to confuse this with the real interpreter -- since it's so " "close!)." msgstr "" "Emula estrictamente la consola interactiva de Python. El argumento opcional " "*banner* especifica la bandera a imprimir antes de la primera interacción; " "de forma predeterminada, imprime una bandera similar al impreso por el " "intérprete estándar de Python, seguido del nombre de clase del objeto de la " "consola entre paréntesis (para no confundir esto con el intérprete real, ¡ya " "que está muy cerca!)" #: ../Doc/library/code.rst:151 msgid "" "The optional *exitmsg* argument specifies an exit message printed when " "exiting. Pass the empty string to suppress the exit message. If *exitmsg* is " "not given or ``None``, a default message is printed." msgstr "" "El argumento opcional *exitmsg* especifica un mensaje de salida que se " "imprime al salir. Pase la cadena de caracteres vacía para suprimir el " "mensaje de salida. Si no se proporciona *exitmsg* o es ``None``, se imprime " "el mensaje predeterminado." #: ../Doc/library/code.rst:155 msgid "To suppress printing any banner, pass an empty string." msgstr "" "Para suprimir la impresión de cualquier bandera, pase una cadena de " "caracteres vacía." #: ../Doc/library/code.rst:158 msgid "Print an exit message when exiting." msgstr "Imprime un mensaje de salida al salir." #: ../Doc/library/code.rst:164 msgid "" "Push a line of source text to the interpreter. The line should not have a " "trailing newline; it may have internal newlines. The line is appended to a " "buffer and the interpreter's :meth:`~InteractiveInterpreter.runsource` " "method is called with the concatenated contents of the buffer as source. If " "this indicates that the command was executed or invalid, the buffer is " "reset; otherwise, the command is incomplete, and the buffer is left as it " "was after the line was appended. The return value is ``True`` if more input " "is required, ``False`` if the line was dealt with in some way (this is the " "same as :meth:`!runsource`)." msgstr "" "Envía una línea de texto fuente al intérprete. La línea no debe tener un " "salto de línea al final; puede tener nuevas líneas internas. La línea se " "agrega a un búfer y se llama al método :meth:`~InteractiveInterpreter." "runsource` del intérprete con el contenido concatenado del búfer y la nueva " "fuente. Si indica que el comando se ejecutó o no es válido, el búfer se " "restablece; de lo contrario, el comando está incompleto y el búfer se deja " "como estaba después de agregar la línea. Si se requieren más entradas el " "valor de retorno es ``True``, ``False`` si la línea se procesó de alguna " "manera (esto es lo mismo que :meth:`!runsource`)." #: ../Doc/library/code.rst:176 msgid "Remove any unhandled source text from the input buffer." msgstr "Elimina cualquier texto fuente no gestionado del búfer de entrada." #: ../Doc/library/code.rst:181 msgid "" "Write a prompt and read a line. The returned line does not include the " "trailing newline. When the user enters the EOF key sequence, :exc:" "`EOFError` is raised. The base implementation reads from ``sys.stdin``; a " "subclass may replace this with a different implementation." msgstr "" "Escribe un *prompt* y lee una línea. La línea retornada no incluye el salto " "de línea final. Cuando el usuario ingresa la secuencia de teclas EOF, se " "lanza :exc:`OFError`. La implementación base lee de ``sys.stdin``; una " "subclase puede reemplazar esto con una implementación diferente."