在visual studio代码中注释python代码

问题描述 投票:0回答:2

我的视觉工作室代码注释python代码与'''而不是使用#尝试用密钥组合ctrl + shift + a注释代码块。我有ubuntu 16.04

python visual-studio-code
2个回答
3
投票

这与Visual Studio没有任何关系,但是python注释样式的结果。通常,单行注释使用井号(或哈希)符号完成:

# This is a comment

相反,可以使用三个引号(“'”或“”“)来轻松生成多行注释。

'''
This is also a comment.
However, this comment crosses multiple lines
'''

要么

"""
This is yet another multiline comment
For long comments the quotation marks are much easier than # comments.
"""

希望这可以帮助。


0
投票

在Windows环境下,这对我有用:

  • 选择块文本
  • 按CTRL + /
© www.soinside.com 2019 - 2024. All rights reserved.