交换通道可以循环读取文件对象中的行。这是内存操作的效率,快速,代码简单。
An alternate approach to reading lines is to loop over the file object. This is memory efficient, fast, and leads to simpler code.
当输入文件中没有其他字符可供读取时,循环结束。
The loop completes when there are no more characters to read in the in file.
若要使用这个库,可以打开此文档并读取文件,然后依次循环主控制块内的每个块,如清单1所示。
You use the library by opening the document and reading the file, followed by looping through each block in the main control block, as shown in Listing 1.
应用推荐