3 Connect to a Display

Create a connection to the display called displayname. If displayname is None or not provided, connect to the default display.

If the connection fails for some reason, one of the errors from the following error class tree is raised:

Exception
 \_error.DisplayError 
    \_error.DisplayNameError
    \_error.DisplayConnectionError

error.DisplayNameError is raised if displayname, or the default display name, is malformed. error.DisplayConnectionError is raised if the connection to the X server fails. This might be caused by the network connection to the display failing, or if the client isn’t authorized to connect to the display.