如下所示:

fr=open("E:\Python\Test\datingTestSet.txt")
arrayOLines = fr.readlines()

open:打开文件

readlines:读取文件