--- a/src/eric7/MicroPython/MicroPythonCommandsInterface.py Tue Feb 07 18:07:12 2023 +0100 +++ b/src/eric7/MicroPython/MicroPythonCommandsInterface.py Wed Feb 08 11:54:36 2023 +0100 @@ -1065,3 +1065,21 @@ return "<unsupported> <unsupported>" raise OSError(self.__shortError(err)) return out.decode("utf-8").strip() + + def getModules(self): + """ + Public method to show a list of modules built into the firmware. + + @return list of builtin modules + @rtype list of str + @exception OSError raised to indicate an issue with the device + """ + commands = ["help('modules')"] + out, err = self.execute(commands) + if err: + raise OSError(self.__shortError(err)) + + modules = [] + for line in out.decode("utf-8").splitlines()[:-1]: + modules.extend(line.split()) + return modules