jackfrued / jackfrued/Python-100-Days
Day21 文件读写示例代码存在问题
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 187k
- Forks
- 55.8k
- PR merge metrics
- No merged PRs in 30d
Description
在 Day21 文档中的以下代码:
data = file1.read(512)
while data:
file2.write(data)
data = file1.read()
这里第二次 read() 没有指定读取大小,
会一次性读取剩余全部数据,
与“分块读取”的教学目标不一致。
建议改为:
data = file1.read(512)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
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.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100