•        Python : 3.7.3
  •          OS : Ubuntu 18.04.2 LTS
  •         IDE : pycharm-community-2019.1.3
  •       Conda : 4.7.5
  •    typesetting : Markdown

code

coder@ubuntu:~$ source activate py37
(py37) coder@ubuntu:~$ ipython
Python 3.7.3 (default, Mar 27 2019, 22:11:17)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.5.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: # 查询对象的方法列表 In [2]: dir(object)
Out[2]:
['__class__',
'__delattr__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__gt__',
'__hash__',
'__init__',
'__init_subclass__',
'__le__',
'__lt__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__setattr__',
'__sizeof__',
'__str__',
'__subclasshook__'] In [3]: dir(list)
Out[3]:
['__add__',
'__class__',
'__contains__',
'__delattr__',
'__delitem__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__getitem__',
'__gt__',
'__hash__',
'__iadd__',
'__imul__',
'__init__',
'__init_subclass__',
'__iter__',
'__le__',
'__len__',
'__lt__',
'__mul__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__reversed__',
'__rmul__',
'__setattr__',
'__setitem__',
'__sizeof__',
'__str__',
'__subclasshook__',
'append',
'clear',
'copy',
'count',
'extend',
'index',
'insert',
'pop',
'remove',
'reverse',
'sort'] In [4]: # 刚开始用Pycharm,它输出的列表在一行上,查看困难。
...: # 使用ipython,有自动换行,方便查看。 In [5]: # 虽然类的方法这么多,可是常用的较少。耐心学习就好。 In [6]: exit
(py37) coder@ubuntu:~$ conda deactivate
coder@ubuntu:~$

resource

  • [文档 - English] docs.python.org/3
  • [文档 - 中文] docs.python.org/zh-cn/3
  • [规范] www.python.org/dev/peps/pep-0008
  • [规范] zh-google-styleguide.readthedocs.io/en/latest/google-python-styleguide/python_language_rules
  • [源码] www.python.org/downloads/source
  • [ PEP ] www.python.org/dev/peps
  • [平台] www.cnblogs.com
  • [平台] gitee.com


Python具有开源、跨平台、解释型、交互式等特性,值得学习。

Python的设计哲学:优雅,明确,简单。提倡用一种方法,最好是只有一种方法来做一件事。

代码的书写要遵守规范,这样有助于沟通和理解。

每种语言都有独特的思想,初学者需要转变思维、踏实践行、坚持积累。

Python3基础 内置函数 dir 查询对象的方法列表的更多相关文章

  1. 2.1 Python3基础-内置函数(print&input)

    >>返回主目录 源代码 # 内置函数:输入/输出 name = 'Portos' age = 18 sex = 'man' score = 99.5 print('Hello World! ...

  2. Python3基础 内置函数 eval str转为list tuple dict

             Python : 3.7.3          OS : Ubuntu 18.04.2 LTS         IDE : pycharm-community-2019.1.3    ...

  3. Python3基础 内置函数 id

             Python : 3.7.3          OS : Ubuntu 18.04.2 LTS         IDE : pycharm-community-2019.1.3    ...

  4. Python3基础 内置函数 hash

             Python : 3.7.3          OS : Ubuntu 18.04.2 LTS         IDE : pycharm-community-2019.1.3    ...

  5. python基础——内置函数

    python基础--内置函数  一.内置函数(python3.x) 内置参数详解官方文档: https://docs.python.org/3/library/functions.html?highl ...

  6. python3.7 内置函数整理

    #!/usr/bin/env python __author__ = "lrtao2010" #python3.7 内置函数整理 #abs(x) #返回数字的绝对值. 参数可以是整 ...

  7. python3.7内置函数整理笔记

    #python3.7 内置函数整理 #abs(x) #返回数字的绝对值. 参数可以是整数或浮点数. 如果参数是复数,则返回其大小 # print(abs(1)) # print(abs(-1)) # ...

  8. 【Python】Python内置函数dir详解

    1.命令介绍 最近学习并使用了一个python的内置函数dir,首先help一下: 复制代码代码如下: >>> help(dir)Help on built-in function ...

  9. python基础7之python3的内置函数

    官方介绍: python3:https://docs.python.org/3/library/functions.html?highlight=built#ascii python2:https:/ ...

随机推荐

  1. windows定时器编程

    目前,Windows下的定时器编程主要有三种方式. 1)SetTimer定时器是利用Windows窗口消息WM_TIMER来实现的.使用方法非常简单,SetTimer创建定时器,KillTimer销毁 ...

  2. Linux下关于Qt无法调用fcitx的中文输入

    1 本机环境: deepin 15.11 Qt 5.11.3 fcitx 输入法 2 问题描述 Qt Creator 和使用 QT 编译的程序运行时均不能使用deepin系统自带的fcitx输入法,且 ...

  3. SQL注入(2)

    SQL注入id  title  content  time  author select * from news where id = 1; select 1,2,3,4,5,6 from table ...

  4. linux命令当前文件夹下面模糊搜索文件

    在当前文件夹下面模糊搜索文件: find . -type f | xargs grep 'boot',"boot"表示文件名中包含的字符串

  5. Intel重大漏洞之Meltdown和Spectre

    史上最大漏洞危机:影响所有 iPhone.Android.PC 设备,修复困难重重 近日,英特尔的日子可并不好过. 作为全球知名芯片制造商,任何有关英特尔芯片漏洞的问题都会导致全球上百万设备遭受牵连. ...

  6. sourceinsight sublimetext主题色配置

    1.sourceinsight发布了4.0版本,全面支持了utf-8编码,这里sourinsight 颜色基本完全按照sublime默认的monokia主题来进行调色,效果如下图所示. 2.配色文件和 ...

  7. .gitignore 标准模板 -适用于SpringBoot+Vue项目 -Idea+VSCode开发

    .gitignore 标准模板 -适用于SpringBoot+Vue项目 node_modules/ target/ !.mvn/wrapper/maven-wrapper.jar ### STS # ...

  8. iwlist/iwconfig/iw命令

    1.iwlist 命令:用于对/proc/net/wireless文件进行分析,得出无线网卡相关信息 # iwlist wlan0 scanning 搜索当前无线网络 # iwlist wlan0 f ...

  9. Spring中AOP方式实现多数据源切换

    作者:suroot spring动态配置多数据源,即在大型应用中对数据进行切分,并且采用多个数据库实例进行管理,这样可以有效提高系统的水平伸缩性.而这样的方案就会不同于常见的单一数据实例的方案,这就要 ...

  10. You Can Customize Synthesized Instance Variable Names @property

    As mentioned earlier, the default behavior for a writeable property is to use an instance variable c ...