호그래머

Python text 파일 읽기 - 방법1 (파일읽기) 23.06.25 본문

Python

Python text 파일 읽기 - 방법1 (파일읽기) 23.06.25

호그래머 2023. 6. 25. 23:22
728x90

1. python text파일 읽기

file_path = "D:/WORK/Python/티스토리/230625/test.txt"

with open(file_path, "r") as file:
    file_content = file.read()
    
print("파일 읽기 완료")
print(file_content)

결과

test.txt 파일 읽기 결과

 

Python으로 text파일을 쉽게 읽을 수 있다.

728x90
Comments