__init__.py - Python for Integrated Circuits - - An Online Book - |
||||||||
| Python for Integrated Circuits http://www.globalsino.com/ICs/ | ||||||||
| ================================================================================= | ||||||||
Creating a package with __init__.py is all about making it easier to develop larger Python projects. The __init__.py provides a mechanism for you to group separate python scripts into a single importable module. without creating the package of __init__.py, we can only import these files if they are in the current directory that whatever script we are running is running from. To use the __init__.py, we can move our scripts into a new subfolder, e.g. naming it "images2". Then, put the created empty __init__.py file, with the following code, into that folder: Code:
|
||||||||
| ================================================================================= | ||||||||
|
|
||||||||