TechNote.kr

  • 홈
  • 태그

context manager 1

Python - with, context manager에 대한 이해.

특정 구문을 시작 전후 반드시 실행해야 하는 구문이 있다면 Python에서는 어떻게 구현할 것인가. 일반적인 코드로 구현하자면 다음과 같다. print("->> Before routine") routine1() print(" Before routine") routine2() print(" Before routine") routine3() print("> Before routine") try: routine1() finally: print(" Before routine") try: routine2() finally: print(" Before routine") try: routine3() finally: print("> Before routine") def __exit__(self, type, value,..

Language/Python 2019.11.16
1
더보기
  • TechNote.
    • Android
    • Language
      • R
      • C
      • Java
      • Python
      • Kotlin
      • HTML
      • Javascript
      • nvd3.js
      • Node.js
    • OS
      • Windows
      • Linux
      • Mac
      • OpenWRT, LEDE
    • Network
      • Wi-Fi
    • Products & Services
      • Django
      • AmazonWebService (AWS)
      • VirtualBox
      • Adsense
      • WordPress
      • Tistory
      • VS Code
      • Docker
    • Database
    • Application
      • KidsTube
      • Notepad++
    • Computer architecture
    • Software architecture
    • ETC

최근글과 인기글

  • 최근글
  • 인기글

Copyright © Kakao Corp. All rights reserved.

티스토리툴바