Windowsでは、Pythonにはchmタイプのドキュメントがあり、読むのに非常に便利です。しかし、Linuxでは、私に読ませてくれるドキュメントはありますか?
最も簡単な方法は、Googleを使用してオンラインドキュメントにアクセスすることです。すべてのモジュールのすべてのドキュメントを見つける単一のポイントはありません。ただし、一般的なものは次のとおりです。
オフラインのドキュメントが必要な場合は、他にもいくつかの可能性があります。
ドキュメントはHTMLまたはPDFとしてダウンロードできます。https://docs.python.org/3/download.html
Webサーバーを実行している場合は、HTMLバージョンを使用して、ブラウザーを使用するのと同じようにアクセスできます。HTMLサイトは、慣れているように見えます。JavaScriptで実装されているため、検索もオフラインで機能します。
Debianのような一部のディストリビューションはpython-doc
パッケージを提供しています。pydoc -p [some port number]
または経由でアクセスできますpydoc -g
。これにより、ローカルWebサーバーが作成されます。次に、ブラウザを開いて確認します。
Pythonインタラクティブコンソールにはhelp(...)
システムが組み込まれています。引数なしで呼び出すこともできます:
$ python
Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> help()
Welcome to Python 2.7! 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://docs.python.org/2.7/tutorial/.
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".
help>
または、何かを知りたいパラメーターを指定して呼び出すこともできます。これは何でもかまいません(モジュール、クラス、関数、オブジェクトなど)。次のようになります。
>>> a = {'b':'c'}
>>> help(a)
Help on dict object:
class dict(object)
| dict() -> new empty dictionary
| dict(mapping) -> new dictionary initialized from a mapping object's
| (key, value) pairs
| dict(iterable) -> new dictionary initialized as if via:
| d = {}
| for k, v in iterable:
| d[k] = v
| dict(**kwargs) -> new dictionary initialized with the name=value pairs
| in the keyword argument list. For example: dict(one=1, two=2)
|
| Methods defined here:
|
| __cmp__(...)
| x.__cmp__(y) <==> cmp(x,y)
|
| __contains__(...)
| D.__contains__(k) -> True if D has a key k, else False
|
| __delitem__(...)
| x.__delitem__(y) <==> del x[y]
|
| __eq__(...)
| x.__eq__(y) <==> x==y
|
| __ge__(...)
| x.__ge__(y) <==> x>=y
|
| __getattribute__(...)
| x.__getattribute__('name') <==> x.name
|
| __getitem__(...)
| x.__getitem__(y) <==> x[y]
|
| __gt__(...)
: (scroll)
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加