有什么方法而不是将功能分配给模块?
我在Python中发现了模块的定义:
“包含函数或属性的结构,我们可以在其中声明变量。”
我们不是每次都需要为模块分配功能,还是有任何方式而不是分配功能?
I found this definition of modules in 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据python文档,我认为我们可以只是更新定义: 一个模块是包含python定义和语句的文件,
因此,如果您don',您实际上不需要在模块中具有函数想要:)
参考:
https://docs.python.org/3/tutorial/modorial/modoriory/modulores.html
Per the Python docs I think we can update the definition just a little: A module is a file containing Python definitions and statements
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