read、readline、readlines
时间: 2023-10-20 14:01:23 浏览: 107
read、readline和readlines是用于读取文件对象的三种常用方法。
read函数用于从文件中读取指定的字节数,如果未给定或为负,则读取所有内容。它返回一个字符串,包含读取的内容。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Python中read,readline,readlines的区别](https://blog.csdn.net/yjk13703623757/article/details/79502998)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [Python基础(十四)——文件操作(read、readline、readlines)](https://blog.csdn.net/qq_42659468/article/details/118887501)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文