![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbT2gBq%2FbtrBJLZv40F%2FrnAUK7SXJUi0tAeSNKcup1%2Fimg.png)
[with ~ as문] 파일 닫기를 생략할 수 있다. 기존에 우리는 이렇게 했었다. from url import * file = open(url()+'practice03.txt','w') file.write('let\' practice with ~ as ~') file.close() with ~ as ~ 를 쓰면 코드가 다음과 같아진다. with open(url()+'practice03.txt','a') as f: f.write('\nthis is the with ~ as 구문') with open(url()+'practice03.txt','r') as f : print(f.read()) ''' let' practice with ~ as ~ this is the with ~ as 구문 ''' close(..