파이썬 중급 (3)

이창영·2023년 10월 20일

ZB_Data_20

목록 보기
4/9

1. 텍스트 파일 쓰기

file = open('C:/pythonTxt/test.txt','w')

strCnt = file.write('Hello world~')
print(f' strCnt : {strCnt}')

file.close()

open() 열기, close() 닫기, read() or write() 읽기, 쓰기
'w' 쓰기모드,

profile
AI개발자를 꿈꾸는 개발자 이창영 입니다.

0개의 댓글