@@ -18,26 +18,35 @@ msgstr ""
1818
1919#: ../Doc/tutorial/inputoutput.rst:5
2020msgid "Input and Output"
21- msgstr ""
21+ msgstr "Entrada y salida "
2222
2323#: ../Doc/tutorial/inputoutput.rst:7
2424msgid ""
2525"There are several ways to present the output of a program; data can be "
2626"printed in a human-readable form, or written to a file for future use. This "
2727"chapter will discuss some of the possibilities."
2828msgstr ""
29+ "Hay diferentes métodos de presentar la salida de un programa; los datos "
30+ "pueden ser impresos de una forma legible por humanos, o escritos a un "
31+ "archivo para uso futuro. Este capítulo discutirá algunas de las "
32+ "posibilidades."
2933
3034#: ../Doc/tutorial/inputoutput.rst:15
3135msgid "Fancier Output Formatting"
32- msgstr ""
36+ msgstr "Formateo elegante de la salida "
3337
3438#: ../Doc/tutorial/inputoutput.rst:17
3539msgid ""
36- "So far we've encountered two ways of writing values: *expression statements* "
37- "and the :func:`print` function. (A third way is using the :meth:`write` "
38- "method of file objects; the standard output file can be referenced as ``sys. "
39- "stdout``. See the Library Reference for more information on this.)"
40+ "So far we've encountered two ways of writing values: *expression statements*"
41+ " and the :func:`print` function. (A third way is using the :meth:`write` "
42+ "method of file objects; the standard output file can be referenced as "
43+ "``sys. stdout``. See the Library Reference for more information on this.)"
4044msgstr ""
45+ "Hasta ahora encontramos dos maneras de escribir valores: *declaraciones de "
46+ "expresión* y la función :func:`print`. (Una tercer manera es usando el "
47+ "método :meth:`write` de los objetos tipo archivo; el archivo de salida "
48+ "estándar puede referenciarse como ``sys.stdout``. Mirá la Referencia de la "
49+ "Biblioteca para más información sobre esto.)"
4150
4251#: ../Doc/tutorial/inputoutput.rst:22
4352msgid ""
@@ -81,17 +90,26 @@ msgstr ""
8190msgid ""
8291"The :func:`str` function is meant to return representations of values which "
8392"are fairly human-readable, while :func:`repr` is meant to generate "
84- "representations which can be read by the interpreter (or will force a :exc: "
85- "`SyntaxError` if there is no equivalent syntax). For objects which don't "
86- "have a particular representation for human consumption, :func:`str` will "
87- "return the same value as :func:`repr`. Many values, such as numbers or "
88- "structures like lists and dictionaries, have the same representation using "
93+ "representations which can be read by the interpreter (or will force a "
94+ ":exc: `SyntaxError` if there is no equivalent syntax). For objects which "
95+ "don't have a particular representation for human consumption, :func:`str` "
96+ "will return the same value as :func:`repr`. Many values, such as numbers or"
97+ " structures like lists and dictionaries, have the same representation using "
8998"either function. Strings, in particular, have two distinct representations."
9099msgstr ""
100+ "La función :func:`str` devuelve representaciones de los valores que son "
101+ "bastante legibles por humanos, mientras que :func:`repr` genera "
102+ "representaciones que pueden ser leídas por el el intérprete (o forzarían un "
103+ ":exc:`SyntaxError` si no hay sintáxis equivalente). Para objetos que no "
104+ "tienen una representación en particular para consumo humano, :func:`str` "
105+ "devolverá el mismo valor que :func:`repr`. Muchos valores, como números o "
106+ "estructuras como listas y diccionarios, tienen la misma representación "
107+ "usando cualquiera de las dos funciones. Las cadenas, en particular, tienen "
108+ "dos representaciones distintas."
91109
92110#: ../Doc/tutorial/inputoutput.rst:68
93111msgid "Some examples::"
94- msgstr ""
112+ msgstr "Algunos ejemplos:: "
95113
96114#: ../Doc/tutorial/inputoutput.rst:91
97115msgid ""
@@ -145,25 +163,32 @@ msgstr ""
145163
146164#: ../Doc/tutorial/inputoutput.rst:144
147165msgid "Basic usage of the :meth:`str.format` method looks like this::"
148- msgstr ""
166+ msgstr "El uso básico del método :meth:`str.format` es como esto:: "
149167
150168#: ../Doc/tutorial/inputoutput.rst:149
151169msgid ""
152170"The brackets and characters within them (called format fields) are replaced "
153- "with the objects passed into the :meth:`str.format` method. A number in the "
154- "brackets can be used to refer to the position of the object passed into the : "
155- "meth:`str.format` method. ::"
171+ "with the objects passed into the :meth:`str.format` method. A number in the"
172+ " brackets can be used to refer to the position of the object passed into the"
173+ " : meth:`str.format` method. ::"
156174msgstr ""
175+ "Las llaves y caracteres dentro de las mismas (llamados campos de formato) "
176+ "son reemplazadas con los objetos pasados en el método :meth:`str.format`. "
177+ "Un número en las llaves se refiere a la posición del objeto pasado en el "
178+ "método. ::"
157179
158180#: ../Doc/tutorial/inputoutput.rst:159
159181msgid ""
160- "If keyword arguments are used in the :meth:`str.format` method, their values "
161- "are referred to by using the name of the argument. ::"
182+ "If keyword arguments are used in the :meth:`str.format` method, their values"
183+ " are referred to by using the name of the argument. ::"
162184msgstr ""
185+ "Si se usan argumentos nombrados en el método :meth:`str.format`, sus valores"
186+ " serán referidos usando el nombre del argumento. ::"
163187
164188#: ../Doc/tutorial/inputoutput.rst:166
165189msgid "Positional and keyword arguments can be arbitrarily combined::"
166190msgstr ""
191+ "Se pueden combinar arbitrariamente argumentos posicionales y nombrados::"
167192
168193#: ../Doc/tutorial/inputoutput.rst:172
169194msgid ""
@@ -172,18 +197,28 @@ msgid ""
172197"instead of by position. This can be done by simply passing the dict and "
173198"using square brackets ``'[]'`` to access the keys ::"
174199msgstr ""
200+ "Si tenés una cadena de formateo realmente larga que no querés separar, "
201+ "podría ser bueno que puedas hacer referencia a las variables a ser "
202+ "formateadas por el nombre en vez de la posición. Esto puede hacerse "
203+ "simplemente pasando el diccionario y usando corchetes ``'[]'`` para acceder "
204+ "a las claves ::"
175205
176206#: ../Doc/tutorial/inputoutput.rst:182
177207msgid ""
178208"This could also be done by passing the table as keyword arguments with the "
179209"'**' notation. ::"
180210msgstr ""
211+ "Esto se podría también hacer pasando la tabla como argumentos nombrados con "
212+ "la notación '**'. ::"
181213
182214#: ../Doc/tutorial/inputoutput.rst:189
183215msgid ""
184- "This is particularly useful in combination with the built-in function :func: "
185- "`vars`, which returns a dictionary containing all local variables."
216+ "This is particularly useful in combination with the built-in function "
217+ ":func: `vars`, which returns a dictionary containing all local variables."
186218msgstr ""
219+ "Esto es particularmente útil en combinación con la función integrada "
220+ ":func:`vars`, que devuelve un diccionario conteniendo todas las variables "
221+ "locales."
187222
188223#: ../Doc/tutorial/inputoutput.rst:192
189224msgid ""
@@ -193,9 +228,11 @@ msgstr ""
193228
194229#: ../Doc/tutorial/inputoutput.rst:209
195230msgid ""
196- "For a complete overview of string formatting with :meth:`str.format`, see : "
197- "ref:`formatstrings`."
231+ "For a complete overview of string formatting with :meth:`str.format`, see "
232+ ": ref:`formatstrings`."
198233msgstr ""
234+ "Para una completa descripción del formateo de cadenas con "
235+ ":meth:`str.format`, mirá en :ref:`string-formatting`."
199236
200237#: ../Doc/tutorial/inputoutput.rst:214
201238msgid "Manual String Formatting"
@@ -228,55 +265,76 @@ msgid ""
228265"There is another method, :meth:`str.zfill`, which pads a numeric string on "
229266"the left with zeros. It understands about plus and minus signs::"
230267msgstr ""
268+ "Hay otro método, :meth:`str.zfill`, el cual rellena una cadena numérica a la"
269+ " izquierda con ceros. Entiende signos positivos y negativos::"
231270
232271#: ../Doc/tutorial/inputoutput.rst:258
233272msgid "Old string formatting"
234- msgstr ""
273+ msgstr "Viejo formateo de cadenas "
235274
236275#: ../Doc/tutorial/inputoutput.rst:260
237276msgid ""
238- "The ``%`` operator can also be used for string formatting. It interprets the "
239- "left argument much like a :c:func:`sprintf`\\ -style format string to be "
277+ "The ``%`` operator can also be used for string formatting. It interprets the"
278+ " left argument much like a :c:func:`sprintf`\\ -style format string to be "
240279"applied to the right argument, and returns the string resulting from this "
241280"formatting operation. For example::"
242281msgstr ""
282+ "El operador ``%`` también puede usarse para formateo de cadenas. Interpreta"
283+ " el argumento de la izquierda con el estilo de formateo de :c:func:`sprintf`"
284+ " para ser aplicado al argumento de la derecha, y devuelve la cadena "
285+ "resultante de esta operación de formateo. Por ejemplo::"
243286
244287#: ../Doc/tutorial/inputoutput.rst:269
245288msgid ""
246289"More information can be found in the :ref:`old-string-formatting` section."
247290msgstr ""
291+ "Podés encontrar más información en la sección :ref:`old-string-formatting`."
248292
249293#: ../Doc/tutorial/inputoutput.rst:275
250294msgid "Reading and Writing Files"
251- msgstr ""
295+ msgstr "Leyendo y escribiendo archivos "
252296
253297#: ../Doc/tutorial/inputoutput.rst:281
254298msgid ""
255299":func:`open` returns a :term:`file object`, and is most commonly used with "
256300"two arguments: ``open(filename, mode)``."
257301msgstr ""
302+ "La función :func:`open` devuelve un `objeto archivo`, y se usa normalmente "
303+ "con dos argumentos: ``open(nombre_de_archivo, modo)``. ::"
258304
259305#: ../Doc/tutorial/inputoutput.rst:293
260306msgid ""
261- "The first argument is a string containing the filename. The second argument "
262- "is another string containing a few characters describing the way in which "
307+ "The first argument is a string containing the filename. The second argument"
308+ " is another string containing a few characters describing the way in which "
263309"the file will be used. *mode* can be ``'r'`` when the file will only be "
264310"read, ``'w'`` for only writing (an existing file with the same name will be "
265311"erased), and ``'a'`` opens the file for appending; any data written to the "
266312"file is automatically added to the end. ``'r+'`` opens the file for both "
267313"reading and writing. The *mode* argument is optional; ``'r'`` will be "
268314"assumed if it's omitted."
269315msgstr ""
316+ "Cuando se lee en modo texto, por defecto se convierten los fines de lineas "
317+ "que son específicos a las plataformas (``\\ n`` en Unix, ``\\ r\\ n`` en "
318+ "Windows) a solamente ``\\ n``. Cuando se escribe en modo texto, por defecto "
319+ "se convierten los ``\\ n`` a los finales de linea específicos de la "
320+ "plataforma. Este cambio automático está bien para archivos de texto, pero "
321+ "corrompería datos binarios como los de archivos :file:`JPEG` o :file:`EXE`."
322+ " Asegurate de usar modo binario cuando leas y escribas tales archivos."
270323
271324#: ../Doc/tutorial/inputoutput.rst:302
272325msgid ""
273326"Normally, files are opened in :dfn:`text mode`, that means, you read and "
274327"write strings from and to the file, which are encoded in a specific "
275328"encoding. If encoding is not specified, the default is platform dependent "
276- "(see :func:`open`). ``'b'`` appended to the mode opens the file in :dfn: "
277- "`binary mode`: now the data is read and written in the form of bytes "
329+ "(see :func:`open`). ``'b'`` appended to the mode opens the file in "
330+ ":dfn: `binary mode`: now the data is read and written in the form of bytes "
278331"objects. This mode should be used for all files that don't contain text."
279332msgstr ""
333+ "Es una buena práctica usar la declaración :keyword:`with` cuando manejamos "
334+ "objetos archivo. Tiene la ventaja que el archivo es cerrado apropiadamente "
335+ "luego de que el bloque termina, incluso si se generó una excepción. También"
336+ " es mucho más corto que escribir los equivalentes bloques :keyword:`try`\\ "
337+ "-\\ :keyword:`finally` ::"
280338
281339#: ../Doc/tutorial/inputoutput.rst:309
282340msgid ""
0 commit comments