Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 9d2e976f12e8ff1c53133a0ee8246441 > files > 30

python-xlib-doc-0.15-6.mga4.noarch.rpm

<HTML>
<HEAD>
<!-- Created by texi2html 1.56k from ../src/python-xlib.texi on 22 October 2013 -->

<TITLE>The Python X Library - Connect to a Display</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="python-xlib_1.html">first</A>, <A HREF="python-xlib_3.html">previous</A>, <A HREF="python-xlib_5.html">next</A>, <A HREF="python-xlib_25.html">last</A> section, <A HREF="python-xlib_toc.html">table of contents</A>.
<P><HR><P>


<H1><A NAME="SEC3" HREF="python-xlib_toc.html#TOC3">Connect to a Display</A></H1>

<P>
To be able to perform any X operations, you must first establish a
connection to the display.  This is done by instantiating a
<CODE>display.Display</CODE> object:


<P>
<DL>
<DT><U>Class:</U> <B>Display</B> <I>( [ displayname ] )</I>
<DD><A NAME="IDX1"></A>


<P>
Create a connection to the display called <VAR>displayname</VAR>.  If
<VAR>displayname</VAR> is None or not provided, connect to the default
display.


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



<PRE>
Exception
 \_error.DisplayError 
    \_error.DisplayNameError
    \_error.DisplayConnectionError
</PRE>

<P>
<CODE>error.DisplayNameError</CODE> is raised if <VAR>displayname</VAR>, or the
default display name, is malformed.  <CODE>error.DisplayConnectionError</CODE>
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.


</DL>

<P>
The syntax of a display name and how the library finds the default
display name depends on the operating system where the client runs.



<UL>
<LI><A HREF="python-xlib_5.html#SEC4">Unix Display Names</A>: Most Unix-style operating systems.
<LI><A HREF="python-xlib_6.html#SEC5">OpenVMS Display Names</A>: Digital^H^H^H^H^H^H^HCompaq OpenVMS.
</UL>

<P><HR><P>
Go to the <A HREF="python-xlib_1.html">first</A>, <A HREF="python-xlib_3.html">previous</A>, <A HREF="python-xlib_5.html">next</A>, <A HREF="python-xlib_25.html">last</A> section, <A HREF="python-xlib_toc.html">table of contents</A>.
</BODY>
</HTML>