Open text files with Python

22 Sep 2022

file = 'xxx.txt'

with open(file, 'r') as f:
    lines = f.readlines()
    for line in lines:
        print(repr(line))

links

social