summaryrefslogtreecommitdiffstats
path: root/Doc/tutorial/inputoutput.rst
Commit message (Collapse)AuthorAgeFilesLines
* gh-132661: PEP 750 documentation: second pass (#137020)Adam Turner2025-08-041-5/+5
|
* gh-132661: Document t-strings and `templatelib` (#135229)Dave Peck2025-07-221-4/+5
| | | | | | | Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Loïc Simon <loic.pano@gmail.com> Co-authored-by: pauleveritt <pauleveritt@me.com>
* gh-85583: Add f-string index in tutorial/inputoutput.rst (GH-21681)amaajemyfren2024-10-301-0/+7
| | | | | | | | | | | | * bpo-41411 fstring index in tutorial/inputoutput To assist in searching for fstrings I have added an index * Add newline --------- Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* gh-122944: Fix incorrect prompt strings in the Python Tutorial (#122949)Damien2024-08-121-2/+2
| | | | In the REPL, top level comments are followed by a primary, not secondary prompt. Fix the places in the in the tutorial that use the latter.
* gh-110383: Improve 'old string formatting' text in tutorial (#120219)Erlend E. Aasland2024-06-071-3/+5
|
* GH-110383: Improve Tutorial for Input Ouput (#119230)Blaise Pabon2024-05-211-4/+16
| | | | Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
* Improve references in the tutorial (GH-108069)Serhiy Storchaka2023-08-211-4/+4
| | | | | * Use full qualified names for references (even if they do not work now, they will work in future). * Silence references to examples.
* GH-97950: Use new-style index directive ('builtin') (#104164)Adam Turner2023-05-061-1/+1
| | | | | | | | | | | | | * Uncomment builtin removal in pairindextypes * Use new-style index directive ('builtin') - C API * Use new-style index directive ('builtin') - Extending * Use new-style index directive ('builtin') - Library * Use new-style index directive ('builtin') - Reference * Use new-style index directive ('builtin') - Tutorial
* GH-97950: Use new-style index directive ('object') (#104158)Adam Turner2023-05-041-1/+1
| | | | | | | | | | | * Uncomment object removal in pairindextypes * Use new-style index directive ('object') - C API * Use new-style index directive ('object') - Library * Use new-style index directive ('object') - Reference * Use new-style index directive ('object') - Tutorial
* GH-97950: Use new-style index directive ('module') (#103996)Adam Turner2023-05-041-1/+1
| | | | | | | | | | | | | | | | | * Use new-style index directive ('module') - C API * Use new-style index directive ('module') - Library * Use new-style index directive ('module') - Reference * Use new-style index directive ('module') - Tutorial * Uncomment module removal in pairindextypes * Use new-style index directive ('module') - C API * Use new-style index directive ('module') - Library * Use new-style index directive ('module') - Reference
* gh-96959: Update HTTP links which are redirected to HTTPS (GH-96961)Serhiy Storchaka2022-09-241-1/+1
|
* gh-81039: Add small example of f-string's "=}" to tutorial (gh-92291)Stanley2022-09-211-1/+11
|
* Doc: Add omitted secondary prompt in inputoutput tutorial (GH-30317)Chenwei Xiao2022-07-231-1/+1
| | | For the continuation lines, "..." should present as secondary prompt
* Docs: remove redundant "adverb-adjective" hyphens from compound modifiers ↵Ned Batchelder2022-07-051-1/+1
| | | | | (GH-94551) Discussion: https://discuss.python.org/t/slight-grammar-fix-throughout-adverbs-dont-need-hyphen/17021
* gh-93240: clarify wording in IO tutorial (GH-93276)paulreece2022-06-211-1/+1
| | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* gh-85679: Recommend `encoding="utf-8"` in tutorial (GH-91778)Inada Naoki2022-05-021-10/+18
|
* bpo-35765: Clarify references to "object x" in the JSON tutorial (GH-22411)Zackery Spytz2021-05-181-1/+2
|
* bpo-17852: Doc: Fix the tutorial about closing files (GH-23135)Volker-Weissmann2020-11-271-5/+10
| | | Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* Improve IO tutorial's "Old string formatting" section (GH-16251)Adorilson Bezerra2020-05-281-5/+5
| | | | | | * Use a more universal explanation of string interpolation rather than specifically referencing sprintf(), which depends on the reader having a C background. Co-authored-by: Kyle Stanley <aeros167@gmail.com>
* bpo-37635: Update arg name for seek() in IO tutorial (GH-16147)Kyle Stanley2019-09-141-3/+3
| | | | | | | | | | | | | | | | | | | Typically, the second positional argument for ``seek()`` is *whence*. That is the POSIX standard name (http://man7.org/linux/man-pages/man3/lseek.3p.html) and the name listed in the documentation for ``io`` module (https://docs.python.org/3/library/io.html#io.IOBase.seek). The tutorial for IO is the only location where the second positional argument for ``seek()`` is referred to as *from_what*. I suspect this was created at an early point in Python's history, and was never updated (as this section predates the GitHub repository): ``` $ git grep "from_what" Doc/tutorial/inputoutput.rst:To change the file object's position, use ``f.seek(offset, from_what)``. The position is computed Doc/tutorial/inputoutput.rst:the *from_what* argument. A *from_what* value of 0 measures from the beginning Doc/tutorial/inputoutput.rst:the reference point. *from_what* can be omitted and defaults to 0, using the ``` For consistency, I am suggesting that the tutorial be updated to use the same argument name as the IO documentation and POSIX standard for ``seek()``, particularly since this is the only location where *from_what* is being used. Note: In the POSIX standard, *whence* is technically the third positional argument, but the first argument *fildes* (file descriptor) is implicit in Python. https://bugs.python.org/issue37635
* Correct info about "f.read(size)". (GH13852)William Andrea2019-09-101-2/+2
| | | In text mode, the "size" parameter indicates the number of characters, not bytes.
* Clarify file-closing example in tutorial (GH-11652)Colin Watson2019-04-171-0/+2
|
* bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174)Serhiy Storchaka2018-12-191-1/+1
|
* bpo-34712: Fix style in examples in "Input and Output" (GH-9361)Ben Hoyt2018-09-191-4/+7
| | | | | | | | | | | A couple of fixes here to make this more PEP-8: * Avoid multiple statements on one line with `;` statement separator -- this is very rare in Python and is "generally discouraged" in PEP 8 (and if used, per PEP 8 there shouldn't be a space before the `;`) * Add output for the first "Formatted String Literals" example. (Side note: are the doctests for this being run? If so, why didn't it fail?) * Avoid space before `!r`. I have generally not seen spaces before the `!`, and this also matches the style used in the docs here: https://docs.python.org/3/library/string.html#format-string-syntax https://bugs.python.org/issue34712
* Doc: Missing 'f' in an f-string. (GH-9074)Julien Palard2018-09-071-1/+1
|
* Remove extra parentheses in output formatting tutorial (GH-8350)Aaqa Ishtyaq2018-07-201-2/+2
| | | The parentheses were incorrect.
* Fix documentation for input and output tutorial (GH-8231)Lysandros Nikolaou2018-07-111-1/+1
| | | The ValueError message ends with a period.
* bpo-28626: rearrange discussion of output formatting to encourage f-strings ↵Andrew Kuchling2018-07-071-89/+138
| | | | | | | | (#6036) The 'output formatting' section of the tutorial talks a lot about manual formatting with things like .rjust() and .zfill(), with only a passing reference to 3.6's new f-strings. This doesn't drop all of the old material, but it does rearrange the topics into a more modern order: f-strings first, discussing formatting specifiers a bit; then calling .format(); finally manual formatting with .ljust().
* bpo-25059: Clarify the print separator usage in tutorial (GH-5879)Cheryl Sabella2018-02-251-1/+1
| | | By default `print` adds spaces between its arguments.
* bpo-6519: Improve Python Input Output Tutorial (GH-2143)Andrew Kuchling2017-06-131-21/+29
| | | Move up the discussion about 'with' keyword, so it appears earlier in the document.
* bpo-30621: Update Input Output Tutorial Example(GH-2074)suketa2017-06-121-0/+1
| | | import json before using json module
* bpo-28315: Improve code examples in docs (GH-1372)UltimateCoder2017-05-031-1/+1
| | | | | | Replace File "<stdin>", line 1, in ? with File "<stdin>", line 1, in <module>
* Issue #23921: Standardized documentation whitespace formatting.Serhiy Storchaka2016-05-101-2/+2
|\ | | | | | | Original patch by James Edwards.
| * Issue #23921: Standardized documentation whitespace formatting.Serhiy Storchaka2016-05-101-2/+2
| | | | | | | | Original patch by James Edwards.
* | merge with 3.5Georg Brandl2016-02-221-5/+5
|\ \ | |/
| * Update example; str(float) changed so there is difference now.Georg Brandl2016-02-221-5/+5
| |
* | Issue #25179: Documentation for formatted string literals aka f-stringsMartin Panter2016-02-131-1/+2
|/ | | | | Some of the inspiration and wording is taken from the text of PEP 498 by Eric V. Smith, and the existing str.format() documentation.
* #26001: mention in the tutorial that files in binary mode expect bytes, not str.Ezio Melotti2016-01-121-7/+8
|
* Issue #24729: Correct reference to open function.Jason R. Coombs2015-07-291-2/+2
|
* Issue #24729: Update tutorial to match implementation.Alessandro Cucci2015-07-281-3/+3
|
* Doc: fix default role usage (except in unittest mock docs)Georg Brandl2014-10-301-2/+2
|
* Issue #18840: Introduce the json module in the tutorial, and deemphasize the ↵Antoine Pitrou2013-12-051-30/+47
| | | | pickle module.
* #16273: Fix tutorial discussion of seek/tell (opaque text-mode values).R David Murray2013-07-301-4/+9
| | | | Patch by Sijin Joseph.
* Issue #18031: %-formatting isn't dead yet and might pull through.Raymond Hettinger2013-05-231-4/+0
|
* #13510: clarify that f.readlines() is note necessary to iterate over a file. ↵Ezio Melotti2013-04-151-15/+4
| | | | Patch by Dan Riti.
* Issue #8890: Stop advertising an insecure use of /tmp in docsPetri Lehtinen2013-02-231-4/+4
|
* Clarify universal-newline wording in tutorial (issue #16266).Chris Jerdonek2012-10-181-3/+4
|
* Issue #16265: Fix collapsing of code sample in tutorial.Andrew Svetlov2012-10-171-1/+1
| | | | Thanks to Yongzhi Pan from docs@
* fix typoSandro Tosi2012-08-141-1/+1
|
* Merge with 3.1.Ezio Melotti2011-03-131-20/+19
|\