본문 바로가기 메뉴 바로가기

Hello, Python

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

Hello, Python

검색하기 폼
  • 분류 전체보기 (146)
    • Python (87)
      • tkinter (12)
    • Java (6)
      • Spring (1)
      • JPA (3)
    • MySQL (2)
    • Linux (19)
    • Virtualization (1)
    • Infra (1)
    • Network (1)
    • VBA(Excel) (19)
    • Apache (3)
    • html (1)
    • Windows (2)
    • 일상다반사 (2)
  • 방명록

doctest (1)
Python,module doctest

외부로 공개할 함수나 클래스 등의 코드를 작성하다 보면, 설명을 아주 자세히 붙어야 할 경우가 많이 있다.심지어는 자세한 설명이나 예제코드조차도 주석으로 자세히 작성해야 할 경우가 많이 있다.이런 예제코드 조차 테스트 데이터로 쓸수 있게 해주는것이 doctest모듈이다. 아래와 같이 div()함수를 만든후 함수에 대한 설명은 물론 예제들도 주석으로 처리하였다.0102030405060708091011121314151617181920212223242526def div(x,y): """ This function is to divide x into y. [examples] >>> div(1,2) 0.5 >>> div(4,3) 1.3333333333333333 >>> div(-1,4) -0.25 >>> div(5..

Python 2016. 5. 25. 18:42
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • borderwidth
  • activebackground
  • onetomany
  • command
  • Private
  • highlightthickness
  • fetch join
  • Linux
  • Composite Key
  • IdClass
  • FetchType
  • Java
  • tkinter
  • Excel
  • 리눅스
  • highlightbackground
  • vba
  • tkinter command & bind [명령어묶기와 사건묶기] Python
  • activeforeground
  • 파이썬
  • checkbutton
  • indicatoron
  • apache
  • 상수
  • 폼
  • ManyToOne
  • JPA
  • Module
  • disabledforeground
  • Python
more
«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바