有什么方法而不是将功能分配给模块?

发布于 2025-02-11 20:49:11 字数 126 浏览 0 评论 0原文

我在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情深缘浅 2025-02-18 20:49:11

根据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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文