2016-11-15 11 views
4

Pythonがすでに持っているライブラリをどのように印刷できますか?などosmathsocketなどPythonネイティブライブラリのリストを印刷

私がインストールしたライブラリを出力します"pip list" || "pip freeze"と同様のプロセスがありますか?

(私はPythonライブラリについてのひどい誤解があれば、私を助けてください。)

+0

[ローカルにインストールされたPythonモジュールの一覧はどのように入手できますか?](http://stackoverflow.com/questions/739993/how-can-i-get-a-list-of-ローカルにインストールされたpythonモジュール) – GAVD

+0

@GAVD最初は同じことを考えました。しかし、私はOPが実際に標準ライブラリのすべてのモジュールを探していると思います。 – idjaw

+0

この場合、ドキュメントでは十分ではないのはなぜですか? – idjaw

答えて

4

あなたがhelp('modules')をプリントアウトすることによってこれを行うことができます:あなたも言葉を一致させるために検索して絞り込むことができ

>>> help('modules') 

Please wait a moment while I gather a list of all available modules... 

IN     aifc    hmac    sf 
__future__   another    html    shelve 
_ast    antigravity   http    shlex 
_bisect    argparse   idlelib    shutil 
_bootlocale   array    imaplib    signal 
_bz2    ast     imghdr    site 
_codecs    asynchat   imp     smtpd 
_codecs_cn   asyncio    importlib   smtplib 
_codecs_hk   asyncore   inspect    sndhdr 
_codecs_iso2022  atexit    io     socket 
_codecs_jp   audioop    ipaddress   socketserver 
_codecs_kr   base64    itertools   something 
_codecs_tw   bdb     json    sqlite3 
_collections  binascii   keyword    sre_compile 
_collections_abc binhex    lib2to3    sre_constants 
_compat_pickle  bisect    linecache   sre_parse 
_compression  builtins   locale    ssl 
_crypt    bz2     logging    stat 
_csv    cProfile   lzma    statistics 
_ctypes    calendar   macpath    string 

大きいので、

のみ出力の数行を示します。あなたは、あなただけでは特定の一つのヘルプを呼び出し、特定のモジュールに役立つことについての詳細を取得したい場合は、次に

>>> help('modules collections') 

Here is a list of modules whose name or summary contains 'collections'. 
If there are any, enter a module name to get more help. 

_collections - High performance data structures. 
_collections_abc - Abstract Base Classes (ABCs) for collections, according to PEP 3119. 
collections 
collections.__main__ 
collections.abc 
test.test_collections - Unit tests for collections.py. 
test.test_defaultdict - Unit tests for collections.defaultdict. 
pip._vendor.requests.packages.urllib3._collections 

:たとえば、「コレクション」と一致するかもしれない何かを検索したいです:

>>> help('collections')