オンラインヘルプを使う

火曜日, 1月 18th, 2011 by

Pythonは、ランタイム環境自体がヘルプ機能を備えているという特徴があります。help()を実行するとヘルプモードが始まります。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
>>> help()

Welcome to Python 2.5!  This is the online help utility.

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://www.python.org/doc/tut/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics".  Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam".

ヘルプモードでモジュール名を入力すると、そのモジュールについての説明が表示されます。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Help on built-in module math:

NAME
    math

FILE
    (built-in)

DESCRIPTION
    This module is always available.  It provides access to the
    mathematical functions defined by the C standard.

FUNCTIONS
    acos(...)
        acos(x)

        Return the arc cosine (measured in radians) of x.

    asin(...)
        asin(x)

        Return the arc sine (measured in radians) of x.

    atan(...)

特定のメソッドについての説明だけを表示することもできます。

1
2
3
4
5
6
7
help> math.sin
Help on built-in function sin in math:

math.sin = sin(...)
    sin(x)

    Return the sine of x (measured in radians).

Facebook comments:

comments

Leave a Reply


Get Adobe Flash player
single