You first step through the file line by line using the readline method.
首先,用readline方法在文件行中移动。
In this case, you should use the readline method, as shown in Listing 5.
在这种情况下,应当使用readline方法,如清单5所示。
When you reach the end of the file, the readline method returns an empty string.
当到达文件末尾时,readline方法返回一个空的string。
readline() and .readlines() are very similar. They are both used in constructs like
readline()和.readlines()非常相似。
Finally, I create a Term: : ReadLine object for user input throughout the application.
最后,为了让用户在整个应用程序中输入数据,我创建了一个Term:ReadLine对象。
The difference between .readline() and .readlines() is that the latter, like .read() , reads an entire file at once.
readline()和 .readlines()之间的差异是后者一次读取整个文件,象 .read() 一样。
The difference between .readline() and .readlines() is that the latter, like .read() , reads an entire file at once.
readline()和 .readlines()之间的差异是后者一次读取整个文件,象 .read() 一样。
应用推荐