I have this folder stu.
Root Folder- Project:
project folder in /Document/office/
| folder
-> File
<code>Project
-> config.py
-> app.py
| Src
-> abc.py
-> xyz.py
| test
-> testcase.py
1 case I want to import config.py in abc.py and xyz.py and in testcase.py
2 case i want to import src.abc in app.py
3 case i want to import abc in test.testcase.py
</code>
<code>Project
-> config.py
-> app.py
| Src
-> abc.py
-> xyz.py
| test
-> testcase.py
1 case I want to import config.py in abc.py and xyz.py and in testcase.py
2 case i want to import src.abc in app.py
3 case i want to import abc in test.testcase.py
</code>
Project
-> config.py
-> app.py
| Src
-> abc.py
-> xyz.py
| test
-> testcase.py
1 case I want to import config.py in abc.py and xyz.py and in testcase.py
2 case i want to import src.abc in app.py
3 case i want to import abc in test.testcase.py
How can I do thin in Python?
i want to import like this:
<code>import config
import src.abc
</code>
<code>import config
import src.abc
</code>
import config
import src.abc
3
<code>from path_to_module import module_name as named_by_you
</code>
<code>from path_to_module import module_name as named_by_you
</code>
from path_to_module import module_name as named_by_you
if you need more please read this : How do I import other Python files?