Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python中的节头注释_Python_Comments - Fatal编程技术网

Python中的节头注释

Python中的节头注释,python,comments,Python,Comments,我在谷歌上搜索过,找不到任何推荐的方法来突出显示带有注释的代码部分的信息 我在想这样的事情: ########################################################### # This section is clearly labeled using comments so you can # instantly identify its purpose within this file. ###############################

我在谷歌上搜索过,找不到任何推荐的方法来突出显示带有注释的代码部分的信息

我在想这样的事情:

###########################################################
# This section is clearly labeled using comments so you can 
# instantly identify its purpose within this file.
###########################################################
例如,我在
php
中经常看到这种情况

python中是否有针对此类内容的约定?如果没有,是否有充分的理由避免

如果这通常是使用多行注释来完成的,请有人提供一个例子,说明如何使用这种“标题”样式来完成

编辑:我知道多行评论。但一般来说,我把它们与一个函数相关联,而不是与一段代码相关联。因此,更具体地说,我在一个文件中为一个小游戏考虑如下内容:

###################################################
#              CONFIGURATION   
##################################################

configuration code...

###################################################
#              HELPER FUNCTIONS
#################################################   

helper functions.....

###################################################
#                 GRAPHICS HANDLING
#######################################################

graphics handling....

我就是这个意思。在

中找到了一些好例子看看这个?您的意思是在IDE中突出显示注释中的代码吗?
##############
# Game Setup #
##############

code...

##################
# Function Setup #
##################

code...

################
# Screen Setup #
################

code...