Index: src/client/python/xplra.py
===================================================================
--- src/client/python/xplra.py	(revision 57)
+++ src/client/python/xplra.py	(revision 64)
@@ -110,4 +110,103 @@
 #-------------------------------------------------------------------------------
 
+if os.name=="nt":
+    import win32file
+    import io
+
+    class Win32NamedPipe(io.RawIOBase):
+        """A stream object to represent a Win32 named pipe."""
+        def __init__(self, name):
+            """Construct the pipe with the given name."""
+            self._handle = win32file.CreateFile(name,
+                                                win32file.GENERIC_READ |
+                                                win32file.GENERIC_WRITE,
+                                                0, None,
+                                                win32file.OPEN_EXISTING, 0, None)
+
+        def close(self):
+            """Close the pipe, if not closed already."""
+            if self._handle is not None:
+                win32file.CloseHandle(self._handle)
+                self._handle = None
+
+        @property
+        def closed(self):
+            """Determine if the pipe is closed or not."""
+            return self._handle is None
+
+        def fileno(self):
+            """Get the file number, which is impossible."""
+            raise IOError("Win32NamedPipe.fileno: not supported")
+
+        def flush(self):
+            """Flush the stream."""
+            pass
+
+        def isatty(self):
+            """Determine if the stream is a terminal, which it is not."""
+            return False
+
+        def read(self, n = -1):
+            """Read at most the given number of bytes from the stream."""
+            if n==-1:
+                return self.readall()
+            else:
+                (error, data) = win32file.ReadFile(self._handle, n)
+                return data
+
+        def readable(self):
+            """Determine if the stream is readable, which it is."""
+            return self._handle is not None
+
+        def readall(self):
+            """Read all bytes from the stream, which is not supported."""
+            raise IOError("Win32NamedPipe.readall: not supported")
+
+        def readinto(self, buffer):
+            """Read into the given buffer."""
+            (error, data) = win32file.ReadFile(self._handle, len(buffer))
+            length = len(data)
+            buffer[:length] = data
+            return length
+
+        def readline(self, limit = -1):
+            """Read a line, which is currently not supported."""
+            raise IOError("Win32NamedPipe.readline: not supported")
+
+        def readlines(self, hint = -1):
+            """Read lines, which is currently not supported."""
+            raise IOError("Win32NamedPipe.readlines: not supported")
+
+        def seek(self, offset, whence = io.SEEK_SET):
+            """Seek in the stream, which is not supported."""
+            raise IOError("Win32NamedPipe.seek: not supported")
+
+        def seekable(self):
+            """Determine if the stream is seekable, which it is not."""
+            return False
+
+        def tell(self):
+            """Get the current position, which is not supported."""
+            raise IOError("Win32NamedPipe.tell: not supported")
+
+        def truncate(self, size = None):
+            """Truncate the stream, which is not supported."""
+            raise IOError("Win32NamedPipe.truncate: not supported")
+
+        def writable(self):
+            """Determine if the stream is writable, which it is."""
+            return self._handle is not None
+
+        def write(self, buffer):
+            """Write the given buffer into the stream."""
+            (error, written) = win32file.WriteFile(self._handle, buffer.tobytes())
+            return written
+
+        def writelines(self, lines):
+            """Write the given lines, which is not supported."""
+            raise IOError("Win32NamedPipe.writelines: not supported")
+
+#-------------------------------------------------------------------------------
+
 class XPlane(object):
     """The main class representing the connection to X-Plane."""
@@ -141,5 +240,6 @@
 
         if os.name=="nt":
-            self._stream = open(r'\\.\pipe\\xplra', "b")
+            pipe = Win32NamedPipe(r'\\.\pipe\\xplra')
+            self._stream = io.BufferedRWPair(pipe, pipe)
         else:
             import socket
