It's the third time I ask this question. My question, I think, is boiled down in my second question, but it was marked as a duplicate, although I really don't understand how to implement the answer I'm referenced to to solve my problem. Google doesn't help too. In short, I have some structure of folders of folders with some python scripts. I want to find the easiest way to transform it to python package.
The last answer I'm referenced to tells that I need to execute all __init__.py
first, but another answer from stack overflow suggest, that to execute file through subprocess
module, but seems it's too difficult to do with my task.
Asked
Active
Viewed 166 times
0

samtestsam
- 61
- 5
-
Start with a simple project, as small as possible, maybe taken from a tutorial, [this one](https://packaging.python.org/tutorials/packaging-projects/) for example, and slowly add to it until you reach your goal. If there is an issue along the way, then post a question with the **whole real code cleanly copy-pasted**, clearly state your **goal**, and what the **hurdle** is. [mcve] – sinoroc Feb 04 '20 at 17:50
-
1You may want to look at [this answer](https://stackoverflow.com/questions/57772706/importing-deeply-nested-modules-in-python) for better understanding. In a nutshell, in your example you can use `from my_package4.my_package4_1.script4_1_1 import my_sum`. – MrBean Bremen Feb 04 '20 at 18:49