개요Python에서 파일을 다룰 때는 파일을 열고 닫는 작업이 필요하다.file = open('somefile', 'w')try: file.write('Hola')finally: file.close()일반적인 프로그래밍에서 연 파일은 반드시 닫는 작업을 해야 하는데, 명시적으로 close 함수를 호출하는 불편함을 해소하기 위해 with 문을 사용할 수 있다.with open("asd.txt", "r") as file: lines = file.readlines() ...이 때 with문을 context manager라고 한다. 그럼 대체 context manger라는 게 뭘까? 알아보자. Context managerContext Manger는 Python의 독특한 기능 중 하나로, ..