标签:odi bsp print -- strip() style read str font
全部读取
f = open("喜洋洋",mode= "r",encoding= "utf-8")
方法一: 一次性全部读取
f = open("喜洋洋",mode= "r",encoding= "utf-8")
print(f.read())
方法二: 一行一行读取(确定量,用for in迭代)
f = open("喜洋洋",mode= "r",encoding= "utf-8")
for line in f # 这里的一行一行读取,却不用readline
print(line.strip())
全部读取------------ 一次性全部读取的.read() VS 一行一行的for迭代
标签:odi bsp print -- strip() style read str font
原文地址:https://www.cnblogs.com/jack20181017/p/9861376.html