不想在__init__.py里注册事件,怎么样可以把逻辑移到其他py文件中去而只在__init__.py中保持轻量化 #609
Answered
by
yanyongyu
axiangcoding
asked this question in
问答
-
|
因为要适配好几个平台,所以会注册很多不同平台的事件,都写在__init__.py里太复杂了。 所以,我如果不想在__init__.py里注册事件,怎么样可以把逻辑移到其他py文件中去而只在__init__.py中保持轻量化?最佳实践是什么样的 |
Beta Was this translation helpful? Give feedback.
Answered by
yanyongyu
Jul 14, 2025
Replies: 1 comment 4 replies
-
|
你可以直接在 |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
你可以直接把 cmd 全都写到 cmd.py 然后
from . import cmd