[python] __enter__, __exit__ context manager - 파이썬 with custom하기
burningrizen.tistory.com/216 [edu] context manager (__enter__, __exit__, with as, 컨텍스트 매니저) [file access] f = open('mytextfile.txt', 'w', encoding='utf8') for x in range(2, 10): for y in range(2, 10): f.write("{:02d} x {:02d} = {:02d}".format(x, y, x*y) + '\n') f.write("\n"*2) f.close() .. burningrizen.tistory.com stackoverflow.com/questions/3774328/implementing-use-of-with-object-as-f-in-custom..