📜  python 应用文件行 - Python 代码示例

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

代码示例1
with open(filename) as f:
    content = f.readlines()
# you may also want to remove whitespace characters like `\n` at the end of each line
content = [x.strip() for x in content]