Added example for the Python client.

This commit is contained in:
Jason Watkins
2015-05-05 15:17:47 -07:00
parent 24768ff140
commit 7d7e0d01b2
3 changed files with 80 additions and 1 deletions

View File

@@ -43,6 +43,13 @@ class XPlaneConnect(object):
def __del__(self):
self.close()
# Define __enter__ and __exit__ to support the `with` construct.
def __enter__(self):
return self
def __exit__(self, type, value, traceback):
self.close()
def close(self):
'''Closes the specified connection and releases resources associated with it.'''
if self.socket is not None: