hello.py
‘‘‘ 文档注释:hello模块 自己定义的 ‘‘‘ # 定义的一个常量,约定俗成:所有字母都大写 SYS_DATA = "ABCDEF" def func(): ‘‘‘ 定义了一个hello函数 :return:无 ‘‘‘ print("hello,this is func") def add(num1, num2): ‘‘‘ 加法 :param num1: :param num2: :return:两数之和 ‘‘‘ return num1 + num2
1. dir:列出所有的属性以及方法
2. __name__:模块的名称
3. __doc__:模块的文档注释
4. __file__:模块的存放路径
5. help:查看类,方法的帮助信息
原文:https://www.cnblogs.com/ac-chang/p/12667982.html