Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/361.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_Ide_Notepad++_Collapse - Fatal编程技术网

制作记事本++;折叠Python三重双内容?

制作记事本++;折叠Python三重双内容?,python,ide,notepad++,collapse,Python,Ide,Notepad++,Collapse,问:我已经尝试了所有Notepad++首选项和选项以及样式配置器,但我找不到一种方法来折叠Python docstring(三个双引号之间的内容)。我们可以这样做吗?或者是否有任何插件支持这种需求 上下文:我决定从ipython笔记本(一个运行在浏览器窗口内的交互式shell)转到Notepad++。原因很简单,Notepad++在定制编辑环境方面提供了更灵活的功能,并且它具有更好的语法高亮显示功能 现在我错过了在代码中折叠一块docstring以更好地理解代码结构的功能(通常它们是OpenCV

问:我已经尝试了所有Notepad++首选项和选项以及样式配置器,但我找不到一种方法来折叠Python docstring(三个双引号之间的内容)。我们可以这样做吗?或者是否有任何插件支持这种需求

上下文:我决定从ipython笔记本(一个运行在浏览器窗口内的交互式shell)转到Notepad++。原因很简单,Notepad++在定制编辑环境方面提供了更灵活的功能,并且它具有更好的语法高亮显示功能

现在我错过了在代码中折叠一块docstring以更好地理解代码结构的功能(通常它们是OpenCV2文档,我只想在脚本中提供它们,而不需要每次需要引用时都访问在线文档)


例如,Netbeans允许折叠代码块、注释块或Javadoc。

Notepad++允许您折叠它认为是代码块的任何东西,它根据缩进来决定。因此,简单的答案是缩进您的文档字符串

"""
    This is a collapsible doc string
"""


"""This is not"""

"""
Neither is this
"""

"""
 This one is, but I think it looks a little odd"""

接受的答案仅适用于文档字符串和人们愿意调整三重引号文本中消息的情况。我目前有一些测试用例,我必须在其中粘贴一条完整的消息,并且我使用了三个双引号。在这种情况下,我不会调整我的多行测试消息,遗憾的是,记事本++只会折叠第一段

    testcases.append("""Lorem Ipsum is simply dummy text of
the printing and typesetting industry. Lorem Ipsum has been
the industry's standard dummy text ever since the 1500s, when
an unknown printer took a galley of type and scrambled it to make
a type specimen book.

It has survived not only five centuries, but also the leap into
electronic typesetting, remaining essentially unchanged. It was
popularized...""")