score_file = open("score.txt", "r", encoding="utf8")
while True:
line = score_file.readline()
if not line:
break
print(line)
score_file.close()
score.txt파일을 읽기 전용으로 열고 .readline()을 이용해 다음 라인의 내용이 없다면 break함 score.txt파일의 내용을 끝까지 읽어옴.
.readline()은 한줄씩 내용일 읽고 커서는 다음줄로 이동함