python 一个sudo代码块,可以显示TouchDesigner扩展的首选格式和文档字符串文档的示例。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 一个sudo代码块,可以显示TouchDesigner扩展的首选格式和文档字符串文档的示例。相关的知识,希望对你有一定的参考价值。

class SampleClass:
    '''
        This is a sample class.

        This sample class has several important features that can be described here.


        Notes
        ---------------
        Your notes about the class go here


        Args
        ---------------
        Args and descriptions would go here, see sample_method for an example


        Returns
        ---------------
        none
    '''

    def __init__( self ):
        print( "sample_class initialized" )
        return

    def Sample_method( self, name, age, height ):
        '''
            This is a sample method.

            This sample method is intended to help illustrate what method docstrings should look like.
                            
            Notes
            ---------------
            'self' does not need to be included in the Args section.

            Args
            ---------------
            name (str)
            > A string name, with spaces as underscores
            
            age (int)
            > Age as full year measurements
            
            height (float)
            > Height in meters to 2 significant digits, ex: 1.45

            Examples
            ---------------

            Returns
            ---------------
            formatted_profile (str)
            > A formatted string populated with the with the supplied information
        '''

        # profile (str): preformatted text with placeholders
        profile = '''
        The following was submitted for review:
        name : {}
        age : {}
        height : {}
        ''' 

        formatted_profile = profile.format( name, age, height )
                    
        return formatted_profile

        self.Sample_method

以上是关于python 一个sudo代码块,可以显示TouchDesigner扩展的首选格式和文档字符串文档的示例。的主要内容,如果未能解决你的问题,请参考以下文章

[Linux]-常用代码块

knitr有没有办法评估其他语言的内联代码块?

Python基本语法与变量的相关介绍

ApppiumPO代码示例

ApppiumPO代码示例

Python 代码块