get_dpi

lib.utils.get_dpi() float | None

Gets the DPI (dots per inch) of the display screen.

Returns:

  • The DPI of the display screen or ``None`` if the dpi couldn’t be obtained (ie (if the function)

  • is called on a headless system)

Return type:

float | None

Example

>>> from lib.utils import get_dpi
>>> get_dpi()
96.0