[Python] txt 파일을 읽을 때, sep를 지정해서 분리하기

2020. 8. 7. 19:30분석 Python

728x90

test.txt

a
b
c
d




q
1
w
3




4
5
6
7




1
2
3
4

 

with open("./test.txt","r") as f :
    data = f.read().split("\n\n\n\n")

728x90