Syntax error Automatic detection of display availability with Matplotlib

Automatic detection of display availability with Matplotlib



To detect display availability with matplotlib, we can take the following steps −

Stps

  • Import os module.

  • Use os.environ["DISPLAY"] to get the available display.

Example

import os

env = os.environ["DISPLAY"]

print("Automatic detected display availability: ", env)

Output

Automatic detected display availability: 0
Updated on: 2021-06-03T13:04:06+05:30

242 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements