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
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- tkinter command & bind [명령어묶기와 사건묶기] Python
- highlightbackground
- Private
- Linux
- vba
- 파이썬
- Excel
- highlightthickness
- activeforeground
- indicatoron
- onetomany
- borderwidth
- Python
- IdClass
- JPA
- Module
- disabledforeground
- apache
- Composite Key
- 상수
- ManyToOne
- Java
- 리눅스
- checkbutton
- tkinter
- command
- FetchType
- fetch join
- 폼
- activebackground
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함