Two packages in one folder

GitHub link: https://github.com/Svtter/2InOne

Could two packages share same folder? The answer is yes.

  1. packagea is in apps
  2. packageb is in apps

And the mainc installed them all, run src/main.py successfully.

The folder tree is:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
├── mainc
│   ├── poetry.lock
│   ├── pyproject.toml
│   └── src
│       └── main.py
├── packagea
│   ├── apps
│   │   └── packagea
│   └── pyproject.toml
├── packageb
│   ├── apps
│   │   └── packageb
│   └── pyproject.toml
└── readme.md

The main.py is:

1
2
3
4
5
6
7
from apps.packagea.a import printa
from apps.packageb.b import printb


if __name__ == "__main__":
    printa()
    printb()
comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计