【发布时间】:2023-04-01 19:28:01
【问题描述】:
这就是我的文件夹的样子(两个文件夹都有空的__init__.py 文件:
.
├── Filter
│ ├── __init__.py
│ └── stp.py
└── Time
├── __init__.py
└── event.py
在 event.py 我目前有(有效):
from Filter.stp import *
但我想将其更改为(导入整个文件夹,因为我实际上有更多文件):
import Filter
我该怎么做?
【问题讨论】:
-
见How to import members of all modules within a package? 它可以让你使用
from Filter import *。 -
这个工作有点。我设法得到:从过滤器导入 *
-
很难在没有更多信息的情况下改进“种类”。
标签: python import module package