티스토리 뷰

Python

Python,module pydoc [도움말]

hwangyoungjae 2016. 5. 25. 18:42
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

pydoc은 자동으로 help()함수와 거의 동일한 스타일의 도움말을 생성해주는 툴이다.

다음과 같이 프롬프트상에서 입력하면 해당 모듈에 대한 설명을 볼수 있다.

C:\Python32\Lib>pydoc.py tkinter

Help on package tkinter:

 

NAME

    tkinter - Wrapper functions for Tcl/Tk.

 

DESCRIPTION

    Tkinter provides classes which allow the display, positioning and

    control of widgets. Toplevel widgets are Tk and Toplevel. Other

    widgets are Frame, Label, Entry, Text, Canvas, Button, Radiobutton,

    Checkbutton, Scale, Listbox, Scrollbar, OptionMenu, Spinbox

    LabelFrame and PanedWindow.

 

    Properties of the widgets are specified with keyword arguments.

    Keyword arguments have the same name as the corresponding resource

    under Tk.

 

    Widgets are positioned with one of the geometry managers Place, Pack

    or Grid. These managers can be called with methods place, pack, grid

    available in every Widget.

 

    Actions are bound to events by resources (e.g. keyword argument

    command) or with the method bind.

 

    Example (Hello, World):

-- More  --

 

다음과 같이 출력스타일을 html로 지정할수도 있다아래와 같이 실행하면 sqlite3.html파일이 생성된다.

Windows 환경 : C:\Python32\Lib>pydoc.py -w tkinter

Linux 환경 : [root@localhost ~]# pydoc sqlite

 

"-k" 옵션을 이용하면 키워드로 검색이 가능하다.

Windows 환경 : C:\Python32\Lib>pydoc.py -k tkinter

Linux 환경 : [root@localhost ~]# pydoc -k sqlite

 

"-p"옵션을 이용하면 웹서버를 띄울수도 있다.

Windows 환경 : C:\Python32\Lib>pydoc.py -p 8888

Linux 환경 : [root@localhost ~]# pydoc -p 8888

 

"-g"옵션을 이용하면 tkinter를 이용해서 GUI창을 띄운다.

C:\Python32\Lib>pydoc.py -g

또는 C:\Python32\Tools\Scripts\pydocgui.pyw 파일을 실행해도 된다.

 

 

참조 : 빠르게 활용하는 파이썬프로그래밍

'Python' 카테고리의 다른 글

Python,module doctest  (0) 2016.05.25
Python,module unittest [단위테스트]  (0) 2016.05.25
Python, 웹 서버 만들기  (0) 2016.05.25
Python, 네이버검색 OpenAPI이용하기  (0) 2016.05.24
Python,module socket [소켓통신]  (0) 2016.05.24
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/07   »
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
글 보관함