Day21 文件读写示例代码存在问题

Open Beginner friendly
#1,172 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
72/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
documentation

Research direction

Find the Day21 documentation and locate the file-reading example containing the two read() calls. Check that the example consistently uses a 512-byte chunk size, then update the second call and review the surrounding text to ensure the example still demonstrates chunked reading.

Written by the indexing model from the issue text.

Description

在 Day21 文档中的以下代码:

data = file1.read(512)
while data:
file2.write(data)
data = file1.read()

这里第二次 read() 没有指定读取大小,
会一次性读取剩余全部数据,
与“分块读取”的教学目标不一致。

建议改为:

data = file1.read(512)

Dominant language
Jupyter Notebook
Stars
187k
Forks
55.8k
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jackfrued/Python-100-Days

All issues in jackfrued/Python-100-Days

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.