📜  从文件python代码示例中读取剥离的行

📅  最后修改于: 2022-03-11 14:46:40.527000             🧑  作者: Mango

代码示例1
with open('file.txt') as f:    lines = [ line.strip() for line in f ]

# Takes approx. 0.10 of a second with a file
# that has 479k single words, each on a new line.