← index #18735PR #2802
Related · high · value 3.742
QUERY · ISSUE

py/builtinhelp: Add options for changing help('modules') format.

openby radiofanopened 2026-01-28updated 2026-01-28
enhancement

Description

Hello, MicoPython community.
We are porting MicroPython on our device. We recently ran into a problem. Width of screen of our device is so small. Default format of help('modules') is poorly displayed. We would like to be able to change it by NUM_COLUMNS and COLUMN_WIDTH.

https://github.com/micropython/micropython/pull/18734

Code Size

No response

Implementation

I intend to implement this feature and would submit a Pull Request if desirable

Code of Conduct

Yes, I agree

CANDIDATE · PULL REQUEST

Implement help('modules') to list available modules

mergedby dpgeorgeopened 2017-01-19updated 2022-07-05

This is how CPython does it, and it's very useful to help users discover the available modules for a given port, especially built-in and frozen modules (and module weak links). The function does not list modules that are in the filesystem because this would require a fair bit of work to do correctly, and is very port specific (depending on the filesystem).

Note that there is no additional config option for this feature, because pyhelp.c is already optional, and if a port wants to implement help() then it's highly likely they want this feature (and users should be allowed to rely on this feature so they can discover modules on a given board).

Example output on pyboard:

>>> help('modules')
__main__          json              stm               umachine
array             lcd160cr          struct            uos
binascii          machine           sys               urandom
builtins          math              time              ure
cmath             micropython       ubinascii         uselect
collections       network           ucollections      usocket
errno             os                uctypes           ustruct
framebuf          pyb               uerrno            utime
gc                random            uhashlib          utimeq
hashlib           re                uheapq            uzlib
heapq             select            uio               zlib
io                socket            ujson
Plus any modules on the filesystem

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied