Understanding python import



I think this is the best article that helps to import sub-directory as module,

https://timothybramlett.com/How_to_create_a_Python_Package_with___init__py.html

The only thing i wanted to say is, if you use

__all__ = ['mymodule1', 'mymodule2']

That's to accomodate syntax such as this

from sub-directory import *

See the magically asterisk there...... all this is for this little baby. :)





Comments

Popular posts from this blog

gemini cli getting file not defined error

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20

vllm : Failed to infer device type