You can use triple-quoted strings.
(您可以使用三引号引起来的字符串。)
When they're not a docstring (first thing in a class/function/module), they are ignored. (如果它们不是文档字符串(类/函数/模块中的第一件事),则将其忽略。)
'''
This is a multiline
comment.
'''
(Make sure to indent the leading '''
appropriately to avoid an IndentationError
.)
((确保适当缩进前导'''
以避免IndentationError
。))
Guido van Rossum (creator of Python) tweeted this as a "pro tip".
(Guido van Rossum(Python的创建者)在推特上发了一条“专业提示”。)
However, Python's style guide, PEP8, favors using consecutive single-line comments , and this is also what you'll find in many projects.
(但是,Python的样式指南PEP8 倾向于使用连续的单行注释 ,这也是在许多项目中都可以找到的。)
Editors usually have a shortcut to do this easily. (编辑人员通常都有捷径可以轻松地做到这一点。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…