【Python】【基础知识】【内置常量】
2020-12-13 15:38
当打印此对象时,会打印出一条消息“Type license() to see the full license text”,当调用此对象时,将以分页形式显示完整的许可证文本(每次显示一屏)。
————————(我是分割线)————————
一般的内置常量
False、True、None、NotImplemented、Ellipsis、__debug__
False、True 属于bool类型
None 属于NoneType
类型
NotImplemented 二进制特殊方法应返回的特殊值
Ellipsis 与省略号文字字面 “...
” 相同。
__debug__
>>> __debug__ True
如果 Python 没有以 -O
选项启动,则此常量为真值。 另请参见 assert
语句。
————————(我是分割线)————————
由 site
模块添加的常量
quit()
(在Windows环境执行,直接退出PythonIDLE,不过退出之前会弹出确认对话框)
exit()
Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> i = 1 >>> print(i) 1 >>> exit Use exit() or Ctrl-Z plus Return to exit >>> exit()
执行后,弹出确认对话框;
copyright
版权/著作权显示:
>>> copyright Copyright (c) 2001-2018 Python Software Foundation. All Rights Reserved. Copyright (c) 2000 BeOpen.com. All Rights Reserved. Copyright (c) 1995-2001 Corporation for National Research Initiatives. All Rights Reserved. Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam. All Rights Reserved. >>>
credits
信誉
>>> credits Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands for supporting Python development. See www.python.org for more information. >>>
感谢 CWI, CNRI, BeOpen.com, Zope Corporation 和数以千计的支持python开发的人员。有关详细信息,请参见www.python.org。
license()
>>> license()
A. HISTORY OF THE SOFTWARE
==========================
Python was created in the early 1990s by Guido van Rossum at Stichting
Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
as a successor of a language called ABC. Guido remains Python‘s
principal author, although it includes many contributions from others.
In 1995, Guido continued his work on Python at the Corporation for
National Research Initiatives (CNRI, see http://www.cnri.reston.va.us)
in Reston, Virginia where he released several versions of the
software.
In May 2000, Guido and the Python core development team moved to
BeOpen.com to form the BeOpen PythonLabs team. In October of the same
year, the PythonLabs team moved to Digital Creations, which became
Zope Corporation. In 2001, the Python Software Foundation (PSF, see
https://www.python.org/psf/) was formed, a non-profit organization
created specifically to own Python-related Intellectual Property.
Zope Corporation was a sponsoring member of the PSF.
All Python releases are Open Source (see http://www.opensource.org for
the Open Source Definition). Historically, most, but not all, Python
Hit Return for more, or q (and Return) to quit: quit
Hit Return for more, or q (and Return) to quit: q
>>>
————————(我是分割线)————————
参考:
1. RUNOOB.COM:https://docs.python.org/zh-cn/3/library/constants.html
备注:
初次编辑时间:2019年9月30日17:55:21
环境:Windows 7 / Python 3.7.2