A module can be as simple as a single python file. By default, it looks for modules in your PYTHONPATH (to view it at runtime, do
If a <module>.py file is in there, or if you have a <module> directory with the right construction, it will be imported.
The "6.1.2 module search path" and "6.4 Packages" (for understanding the PyBluez setup) are important bits from the links in Yoriz's post. They're not just definitions.
import sys
and then print(sys.path)
.If a <module>.py file is in there, or if you have a <module> directory with the right construction, it will be imported.
The "6.1.2 module search path" and "6.4 Packages" (for understanding the PyBluez setup) are important bits from the links in Yoriz's post. They're not just definitions.
$ echo 'print("Hello, I am a module")' > foo.py $ python3 Python 3.8.2 (default, Feb 27 2020, 15:22:23) [Clang 11.0.0 (clang-1100.0.33.12)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import foo Hello, I am a module