一、前言
想要了解 Python 当中的所有关键字,可以在 Linux 系统中使用 ipython 或者 ipython3 工具。
二、操作步骤
rootabackvm-virtual-machine:backvm# ipython3 # 命令
Python 3.5.2 (default,Jan 26 2021,13:30:48)
Type "copyright",
"credits"or "license"for more information.
IPython 2.4.1 -An enhanced Interactive Python.
-Introduction and overview of IPython's features
%quickref -Quick reference.
help
-Python's own help system.
object?
-Details about 'object',use 'object??'for extra details.
In [1]:import keyword # 步骤1:导入模块
In [2]:print(keyword. # tab键补全
keyword.iskeyword keyword.kwlist
keyword.main
In [2]:print(keyword.kwlist) # 步骤2:打印关键字列表
['False','None','True','and','as','assert','break','class','continue',
'def','del','elif','else','except','finally','for','from','global',
'if','import','in','is','lambda','nonlocal','not','or','pass',
'raise','return','try','while','with','yield']
In [3]:quit # 退出
root@backvm-virtual-machine:backvm#