~~~
interactive [ɪntər'æktɪv] adj. 交互式的
prompt [prɒm(p)t] n. 提示符;系统提示符;DOS命令
~~~
help
---------
在 Python interactive prompt (Python交互提示符)下获取帮助信息
~~~
help(thing) -- 显示 thing 帮助信息
help() -- 进入 help 交互会话
~~~
#### help(thing)
- help(模块)
- help(模块.函数/类)
- help(方法描述符)
- help("xxx") -- 不建议使用,
tips:使用 help 时,需提前引入相关模块
~~~
>>> help(math)
>>> help(math.acos)
>>> help(list.index) # list 不是模块
~~~
#### help()
在Python交互环境中输入help()进入help会话。
在 help 回话中直接输入要查询的 thing 即可获取其帮助信息。
在 help 回话中使用 enter 回车返回 Python 交互环境
#### help文档
换行:enter
翻页:space
退出:q
查看 Python 关键字
--------------------
~~~
False def if raise
None del import return
True elif in try
and else is while
as except lambda with
assert finally nonlocal yield
break for not
class from or
continue global pass
~~~
~~~
>>>help('keywords') -- 返回如上,不建议使用help("thing")模式
或
>>> from keyword import kwlist
>>> kwlist
['False','None', 'True', ...]
~~~
- 前言
- Python编程规范
- 编码
- 代码
- 缩进、行宽、引号、空行
- 空格
- 换行
- import
- 注释
- 代码注释
- 文档注释(Docstring)
- 命名规范
- 数据结构
- 变量
- 变量作用域
- 命名空间
- 作用域
- python作用域
- 对象
- 序列
- 可迭代对象
- 迭代器
- 生成器
- 可迭代对象 & 迭代器 & 生成器
- 整数池 & 字符串intern
- 数据类型
- 数字
- int
- float
- NaN
- 四舍五入 & 取整
- 列表
- 元组
- 字典
- 集合
- 字符串
- 字符集&字符编码
- 字符串&字节串
- 字符串函数
- 字符串格式化
- str.format
- Formatted string literals
- format函数
- string.Formatter类
- %
- Format String Syntax
- Format Specification Mini-Language
- fill
- align
- sign
- #
- 0
- width
- grouping_option
- .precision
- type
- locale
- Python3 locale 模块
- 语句
- 运算符
- if/else
- for...in
- while
- break/continue
- 函数
- 函数
- 函数参数
- 递归函数
- 匿名函数
- 高阶函数
- map
- reduce
- filter
- sorted
- 返回函数
- 闭包
- 装饰器
- 函数装饰器
- 带参数的装饰器
- 类装饰器
- 带参数的类装饰器
- 偏函数
- 面向对象
- 类 & 实例
- 属性
- 方法
- 访问限制
- 继承
- 新式类 & 经典类
- MRO
- MixIn
- 模块
- 特殊变量
- 编写模块
- 引入 & 重载
- 搜索模块
- 第三方模块
- 常见模块
- 标准库
- os
- sys
- datetime
- re
- urllib
- time/datetime
- threading
- multiprocessing
- builtins
- help
- range
- enumerate
- 异同
- str() repr() ascii()
- exit()、sys.exit()、os._exit()
- 数据库
- mysql
- 错误、调试、测试
- 异常
- 异常处理
- 自定义异常
- 抛出异常
- 调试
- logging
- pdb
- 线程&&进程
- 线程
- 杂
- python 脚本传参
- python无关
- redis
- mongo
- linux
- mysql简略