Import modules from file system

Python code can access code in modules using the builtin import command. When executing the line import foo, MicroPython goes through each entry in sys.path looking for a module called foo. It first checks for a package by looking for the file __init__.py in the directory foo. It then checks for a file foo.py and finally foo.mpy (a pre-compiled Python file) before moving to the next entry in sys.path.

On startup, the XBee device sets its sys.path to a default of ['', '/flash', '/flash/lib'].