➜ tree
.
└── smart_door
└── open.py
1 directory, 1 file
➜ cat smart_door/open.py
print("I have opened")
➜ python
Python 3.7.2 (default, Jan 13 2019, 22:54:07)[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license"for more information.
>>> from smart_door import open
I have opened
An example:
You can read more about it here.