[英]Is there any way rather than assigning functions to modules?
I found this definition of modules in Python:我在 Python 中找到了这个模块的定义:
"Structures that contain functions or properties, in which we can declare variables." “包含函数或属性的结构,我们可以在其中声明变量。”
Don't we need to assign functions to modules every time, or is there any way rather than assigning functions?我们不是每次都需要为模块分配功能,还是有什么办法可以不用分配功能?
Per the Python docs I think we can update the definition just a little: A module is a file containing Python definitions and statements根据 Python 文档,我认为我们可以稍微更新一下定义:模块是包含 Python 定义和语句的文件
So you don't really need to have a function in a module if you don't want :)因此,如果您不想要,您实际上并不需要在模块中具有功能:)
Reference: https://docs.python.org/3/tutorial/modules.html参考: https ://docs.python.org/3/tutorial/modules.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.