# read(),可以传如参数size,为从头读取多少个字符
f = open("a.txt")
lines = f.read(2)
print(lines)
print(type(lines))
f.close()
# readlines() 读取整个文件,每行作为一个元素存入一个list
# f = open("a.txt")
# lines = f.readlines()
# print(type(lines))
# for line in lines:
# print (line)
# f.close()
# readline() 按行读取
# f = open("a.txt")
# line = f.readline()
# print(type(line))
# while(line):
# print (line)
# line = f.readline()
#
# f.close()