---
# System prepended metadata

title: Python - Modules
tags: [python]

---

# Python - Modules
https://appdividend.com/2022/06/03/how-to-import-class-from-another-file-in-python/
https://www.pythonpool.com/import-classes-from-another-file-in-python/


## Import Classes From Another File
- Add `__init__.py` in the module folder
- Should not name the file name with `.` , eg, `base.page.py`, otherwise it leads to the **module not found error** (`.` is for the route of folder layers)
- Use `.` to locate the `.py` file in the folder
    - ![](https://hackmd.io/_uploads/ByQZxXV35.png)



###### tags: `python`