新网创想网站建设,新征程启航

为企业提供网站建设、域名注册、服务器等服务

Python实现使用dir获取类的方法列表-创新互联

使用Python的内置方法dir,可以范围一个模块中定义的名字的列表。

创新互联公司是一家网站设计公司,集创意、互联网应用、软件技术为一体的创意网站建设服务商,主营产品:响应式网站设计成都品牌网站建设成都全网营销推广。我们专注企业品牌在网站中的整体树立,网络互动的体验,以及在手机等移动端的优质呈现。成都网站建设、网站建设、移动互联产品、网络运营、VI设计、云产品.运维为核心业务。为用户提供一站式解决方案,我们深知市场的竞争激烈,认真对待每位客户,为客户提供赏析悦目的作品,网站的价值服务。

官方解释是:

Docstring:
dir([object]) -> list of strings

If called without an argument, return the names in the current scope.
Else, return an alphabetized list of names comprising (some of) the attributes
of the given object, and of attributes reachable from it.
If the object supplies a method named __dir__, it will be used; otherwise
the default dir() logic is used and returns:
 for a module object: the module's attributes.
 for a class object: its attributes, and recursively the attributes
  of its bases.
 for any other object: its attributes, its class's attributes, and
  recursively the attributes of its class's base classes.

网站栏目:Python实现使用dir获取类的方法列表-创新互联
标题来源:http://www.wjwzjz.com/article/gdppg.html
在线咨询
服务热线
服务热线:028-86922220
TOP