I want to list if multiply displays are available in Ubuntu/Debian using python3 (if a display is connected to ubuntu with VGA or HDMI), or when an external display connected detect.

I don't have any idea to do that if everyone has any way please help me.