讲师中心 微信公众号

工具推荐

视频效率加速
立刻MV
立刻MV

低成本歌曲 MV、视频生成

SoundView
SoundView

字幕擦除翻译、配音口型同步

AniShort
AniShort

AI短剧协同制作平台

剧云
剧云

中文短剧剧本制作平台

查看python的可用模块

星萱吖_7388

星萱吖_7388

发布时间:2016-10-19 15:00:37

|

2678人浏览过

|

来源于php中文网

原创

1.这种方式的问题是,只列出当前import进上下文的模块.

进入python命令行.输入以下代码:

Define repeatable Python automation sessions in code with nox
Define repeatable Python automation sessions in code with nox

将测试、lint、构建和文档流程编码为命名的Python会话,以便人类和代理每次运行相同的workflow。

下载
$ python
Python 2.7.2 (default, Jan 19 2012, 18:26:31)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.modules
{'copy_reg': <module 'copy_reg' from '/usr/local/lib/python2.7/copy_reg.pyc'>, 'sre_compile': <module 'sre_compile' from '/usr/local/lib/python2.7/sre_compile.pyc'>, '_sre': <module '_sre' (built-in)>, 'encodings': <module 'encodings' from '/usr/local/lib/python2.7/encodings/__init__.pyc'>, 'site': <module 'site' from '/usr/local/lib/python2.7/site.pyc'>, '__builtin__': <module '__builtin__' (built-in)>, 'sysconfig': <module 'sysconfig' from '/usr/local/lib/python2.7/sysconfig.pyc'>, '__main__': <module '__main__' (built-in)>, 'encodings.encodings': None, 'abc': <module 'abc' from '/usr/local/lib/python2.7/abc.pyc'>, 'posixpath': <module 'posixpath' from '/usr/local/lib/python2.7/posixpath.pyc'>, '_weakrefset': <module '_weakrefset' from '/usr/local/lib/python2.7/_weakrefset.pyc'>, 'errno': <module 'errno' (built-in)>, 'encodings.codecs': None, 'sre_constants': <module 'sre_constants' from '/usr/local/lib/python2.7/sre_constants.pyc'>, 're': <module 're' from '/usr/local/lib/python2.7/re.pyc'>, '_abcoll': <module '_abcoll' from '/usr/local/lib/python2.7/_abcoll.pyc'>, 'types': <module 'types' from '/usr/local/lib/python2.7/types.pyc'>, '_codecs': <module '_codecs' (built-in)>, '_warnings': <module '_warnings' (built-in)>, 'genericpath': <module 'genericpath' from '/usr/local/lib/python2.7/genericpath.pyc'>, 'stat': <module 'stat' from '/usr/local/lib/python2.7/stat.pyc'>, 'zipimport': <module 'zipimport' (built-in)>, 'encodings.__builtin__': None, 'warnings': <module 'warnings' from '/usr/local/lib/python2.7/warnings.pyc'>, 'UserDict': <module 'UserDict' from '/usr/local/lib/python2.7/UserDict.pyc'>, 'encodings.utf_8': <module 'encodings.utf_8' from '/usr/local/lib/python2.7/encodings/utf_8.pyc'>, 'sys': <module 'sys' (built-in)>, 'codecs': <module 'codecs' from '/usr/local/lib/python2.7/codecs.pyc'>, 'readline': <module 'readline' from '/usr/local/lib/python2.7/lib-dynload/readline.so'>, 'os.path': <module 'posixpath' from '/usr/local/lib/python2.7/posixpath.pyc'>, 'signal': <module 'signal' (built-in)>, 'traceback': <module 'traceback' from '/usr/local/lib/python2.7/traceback.pyc'>, 'linecache': <module 'linecache' from '/usr/local/lib/python2.7/linecache.pyc'>, 'posix': <module 'posix' (built-in)>, 'encodings.aliases': <module 'encodings.aliases' from '/usr/local/lib/python2.7/encodings/aliases.pyc'>, 'exceptions': <module 'exceptions' (built-in)>, 'sre_parse': <module 'sre_parse' from '/usr/local/lib/python2.7/sre_parse.pyc'>, 'os': <module 'os' from '/usr/local/lib/python2.7/os.pyc'>, '_weakref': <module '_weakref' (built-in)>}
2.还可以在python命令行下获取在线帮助:
>>> 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/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".


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

/usr/local/lib/python2.7/site-packages/nltk/app/__init__.py:30: UserWarning: nltk.app package not loaded (please install Tkinter library).
 warnings.warn("nltk.app package not loaded "
/usr/local/lib/python2.7/site-packages/nltk/draw/__init__.py:16: UserWarning: nltk.draw package not loaded (please install Tkinter library).
 warnings.warn("nltk.draw package not loaded "
/usr/local/lib/python2.7/site-packages/twisted/words/im/__init__.py:8: UserWarning: twisted.im will be undergoing a rewrite at some point in the future.
 warnings.warn("twisted.im will be undergoing a rewrite at some point in the future.")
ArgImagePlugin      _LWPCookieJar       dumbdbm             readability
BaseHTTPServer      _MozillaCookieJar   dummy_thread        readline
Bastion             __builtin__         dummy_threading     redis
BdfFontFile         __future__          easy_install        repr
BeautifulSoup       _abcoll             email               resource
BeautifulSoupTests  _ast                encodings           rexec
BmpImagePlugin      _bisect             engine              rfc822
BufrStubImagePlugin _codecs             errno               rlcompleter
CDROM               _codecs_cn          exceptions          robotparser
CGIHTTPServer       _codecs_hk          ext                 runpy
Canvas              _codecs_iso2022     fcntl               sched
ConfigParser        _codecs_jp          filecmp             scrapy
ContainerIO         _codecs_kr          fileinput           scrapyd
Cookie              _codecs_tw          fnmatch             select
Crypto              _collections        formatter           server
CurImagePlugin      _csv                fpformat            sets
DLFCN               _ctypes             fractions           setuptools
DcxImagePlugin      _ctypes_test        ftplib              sgmllib
Dialog              _curses             functools           sha
DocXMLRPCServer     _curses_panel       future_builtins     shelve
EpsImagePlugin      _elementtree        gc                  shlex
ExifTags            _functools          genericpath         shutil
FileDialog          _hashlib            getopt              signal
FitsStubImagePlugin _heapq              getpass             site
FixTk               _hotshot            gettext             six
FliImagePlugin      _imaging            glob                smtpd
FontFile            _imagingcms         grp                 smtplib
FpxImagePlugin      _imagingft          gzip                sndhdr
GbrImagePlugin      _imagingmath        hashlib             socket
GdImageFile         _io                 heapq               spwd
GifImagePlugin      _json               hmac                sql
GimpGradientFile    _locale             hotshot             sqlalchemy
GimpPaletteFile     _lsprof             htmlentitydefs      sqlite3
GribStubImagePlugin _md5                htmllib             sre
HTMLParser          _multibytecodec     httplib             sre_compile
Hdf5StubImagePlugin _multiprocessing    idlelib             sre_constants
IN                  _mysql              ihooks              sre_parse
IcnsImagePlugin     _mysql_exceptions   imaplib             ssl
IcoImagePlugin      _pyio               imghdr              stat
ImImagePlugin       _random             imp                 statvfs
Image               _sha                importlib           string
ImageChops          _sha256             imputil             stringold
ImageCms            _sha512             inspect             stringprep
ImageColor          _socket             io                  strop
ImageDraw           _sre                itertools           struct
ImageDraw2          _ssl                json                subprocess
ImageEnhance        _strptime           keyword             sunau
ImageFile           _struct             lib2to3             sunaudio
ImageFileIO         _symtable           linecache           symbol
ImageFilter         _testcapi           linuxaudiodev       symtable
ImageFont           _threading_local    locale              sys
ImageGL             _warnings           logging             sysconfig
ImageGrab           _weakref            lxml                syslog
ImageMath           _weakrefset         macpath             tabnanny
ImageMode           _yappi              macurl2path         tarfile
ImageOps            abc                 mailbox             telnetlib
ImagePalette        aifc                mailcap             tempfile
ImagePath           antigravity         markupbase          termios
ImageQt             anydbm              marshal             test
ImageSequence       argparse            math                tests
ImageShow           array               mcrypt              textwrap
ImageStat           ast                 md5                 this
ImageTk             asynchat            mhlib               thread
ImageTransform      asyncore            mimetools           threading
ImageWin            atexit              mimetypes           thrift
ImtImagePlugin      audiodev            mimify              time
IptcImagePlugin     audioop             mmap                timeit
JpegImagePlugin     base64              modulefinder        tkColorChooser
McIdasImagePlugin   bdb                 multifile           tkCommonDialog
MicImagePlugin      binascii            multiprocessing     tkFileDialog
MimeWriter          binhex              mutex               tkFont
MpegImagePlugin     bisect              netrc               tkMessageBox
MspImagePlugin      bsddb               new                 tkSimpleDialog
MySQLdb             bz2file             nis                 toaiff
OleFileIO           cPickle             nltk                token
OpenSSL             cProfile            nntplib             tokenize
PIL                 cStringIO           ntpath              tornado
PSDraw              calendar            nturl2path          trace
PaletteFile         cgi                 numbers             traceback
PalmImagePlugin     cgitb               opcode              transport
PcdImagePlugin      chardet             operator            ttk
PcfFontFile         chunk               optparse            tty
PcxImagePlugin      cmath               orm                 turtle
PdfImagePlugin      cmd                 os                  twisted
PixarImagePlugin    code                os2emxpath          types
PngImagePlugin      codecs              ossaudiodev         unicodedata
PpmImagePlugin      codeop              parser              unittest
PsdImagePlugin      collections         pdb                 urllib
Queue               colorsys            pickle              urllib2
ScrolledText        command             pickletools         urlparse
SgiImagePlugin      commands            pip                 user
SimpleDialog        compileall          pipes               util
SimpleHTTPServer    compiler            pkg_resources       uu
SimpleXMLRPCServer  connectors          pkgutil             uuid
SocketServer        constants           platform            virtualenv
SpiderImagePlugin   contextlib          plistlib            virtualenv_support
StringIO            cookielib           popen2              w3lib
SunImagePlugin      copy                poplib              warnings
TYPES               copy_reg            posix               wave
TarIO               crypt               posixfile           weakref
TgaImagePlugin      csv                 posixpath           web
TiffImagePlugin     ctypes              pprint              webbrowser
TiffTags            curses              profile             whichdb
Tix                 databases           protocol            wsgiref
Tkconstants         datetime            pstats              xdrlib
Tkdnd               dateutil            pty                 xml
Tkinter             dbhash              pwd                 xmllib
UserDict            decimal             py_compile          xmlrpclib
UserList            dialects            pyclbr              xxsubtype
UserString          difflib             pydoc               yaml
WalImageFile        dircache            pydoc_data          yappi
WmfImagePlugin      dis                 pyexpat             zipfile
XVThumbImagePlugin  distutils           quopri              zipimport
XbmImagePlugin      django              random              zlib
XpmImagePlugin      doctest             re                  zope

Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose descriptions contain the word "spam".

相关文章

python速学教程(入门到精通)
python速学教程(入门到精通)

python怎么学习?python怎么入门?python在哪学?python怎么学才快?不用担心,这里为大家提供了python速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载

相关标签:

本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热门AI工具

更多
豆包大模型

豆包大模型是一款由字节跳动推出的企业级大语言模型服务平台。

墨刀AI
墨刀AI Hot

一款AI图像与设计工具,主要用于产品经理的专属智能体,适合需要提升相关任务效率的用户。

码上飞
码上飞 Hot

一款基于自然语言的AI应用开发平台,可根据用户描述自动生成应用程序,帮助个人和团队快速完成应用原型与开发。

PixPix
PixPix Hot

PixPix是一款面向电商视觉生产的AI商品图生成工具。

WorkBuddy

一款AI办公效率工具,主要用于腾讯云推出的AI原生桌面智能体工作台,适合需要提升相关任务效率的用户。

二狗PPT
二狗PPT Hot

一款AI演示文稿工具,主要用于专为中式职场打造的AI PPT生成工具,适合需要提升相关任务效率的用户。

DeepSeek

DeepSeek是一款面向对话、写作、编程和推理场景的AI大模型工具。

UP简历
UP简历 Hot

一款AI办公效率工具,主要用于基于AI技术的免费在线简历制作工具,适合需要提升相关任务效率的用户。

立刻MV
立刻MV Hot

立刻MV是一款AI文本写作工具,AI 音乐视频(MV)创作工具。

相关专题

更多
Navicat创建数据库教程
Navicat创建数据库教程

本专题整理Navicat创建数据库相关教程,介绍新建前的准备、基础设置和创建后的检查方法。内容兼顾入门学习及实际使用需求,帮助用户了解不同数据库类型下的操作差异,为后续建表、保存数据和日常管理提供参考。

20

2026.11.20

Navicat入门教程大全
Navicat入门教程大全

本专题整理Navicat入门教程,从认识软件界面到开展数据库操作,介绍初次使用需要了解的知识和方法。内容兼顾连接配置、数据管理及日常使用中的疑问,方便用户按学习进度查阅,为后续实践和独立操作打好基础。

20

2026.11.20

Navicat数据库连接配置指南
Navicat数据库连接配置指南

从确认数据库信息到建立可用连接,本专题串联Navicat连接数据库的相关知识和操作方法。既有初次配置时需要了解的基础内容,也有连接后的检查思路,方便用户按实际需求查阅教程,逐步熟悉数据库连接的设置流程。

0

2026.11.20

PHP8.6数组与数据处理教程
PHP8.6数组与数据处理教程

本专题汇总PHP8.6数组与数据处理教程,涵盖CSV读取和导出、引用遍历删除、array_filter回调模式、配置键名冲突、pathinfo文件名校验、GMP大整数进制转换及UTF-8正则筛选,说明升级兼容变化、输入范围和失败处理方法。

60

2026.11.20

PHP8.6升级迁移教程
PHP8.6升级迁移教程

本专题汇总PHP8.6升级迁移与弃用接口改造教程,涵盖反射调用、对象属性赋值、标识符更名、构造函数与__debugInfo调整,以及插件类名检查、常量导出、ArrayIterator排序、SPL和DTO查询参数转换,帮助梳理弃用提示并完成代码兼容改造。

0

2026.11.20

PHP8.6安装配置与FPM运维教程
PHP8.6安装配置与FPM运维教程

本专题汇总PHP8.6正式版安装部署与FPM运维教程,涵盖Linux并存安装、独立ini配置、扩展重新编译、Nginx切换与回滚、FPM状态监控和慢日志排查,以及环境变量、请求超时、OPcache刷新和预加载配置。

40

2026.11.20

Nginx CVE-2026-123007排查与防护指南
Nginx CVE-2026-123007排查与防护指南

Nginx HTTP/2漏洞该怎么修复?本专题围绕CVE-2026-123007,介绍安全版本升级、模块兼容检查和配置恢复方法,以及日志排查、权限设置等后续加固操作,方便你按实际部署情况查找对应教程。

40

2026.11.20

GoFrame框架Web开发与路由中间件
GoFrame框架Web开发与路由中间件

本专题聚焦GoFrame框架的Web开发,拆解路由注册与匹配规则、请求参数获取、参数校验与中间件执行顺序,说明统一响应、JWT鉴权、文件上传与接口文档生成的落地方式,并补充优雅重启与测试实践。

80

2026.11.17

GoFrame框架安装与gf命令行工具
GoFrame框架安装与gf命令行工具

本专题围绕GoFrame框架的安装与工具链配置展开,讲清Go版本要求、gf命令行的安装方式、代理镜像与依赖准备,说明项目初始化、热编译、交叉编译打包的做法,并整理安装阶段的常见报错与验证步骤。

100

2026.11.17

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn