Can anyone help me with a question, if a python package is imported can we directly import package inside another package in package?
Lets say a python pkg structure is like:
module
|__ module1
| |__ __init__.py
| |__ pyScript1.py
| |__ pyScript2.py
|__ __init__.py
Then is a python script if we have a script like import module
Can we call the pyScript1 using module.pyScript1
without importing module1?
I know this will work by adding all in module > init.py file and add the module1 sub packages in it. but when I run dir(module)
I can see module1 in the list. But I don't want to see module1 in dir list.
Can anyone help with this?
EDIT:
What if instead of 'module1' if we have multiple version modules in 'module' like '1_0_0, 1_1_0, 2_0_0,...etc' and we maintain and environmental variable MODULE_VERSION=1.1.0
and according to the version specified we need to refer to that particular version module.