google questions and answers

1. 如何用readline读完整个文件

handle = open(fname)
while 1:
    line = handle.readline()
    if not line:
        break
handle.close()


你可能感兴趣的:(google questions and answers)