====== Example Python Server UDP code for X-Plane 11 ====== * Example is from: https://github.com/charlylima/XPlaneUDP * Information about converting struct data structures using Python: https://docs.python.org/3/library/struct.html #!/usr/bin/python # Example how to receive UDP Data from X-Plane 10 in Python3. # License: # 1) GPLv3 # 2) Consider it as programmer documentation, so you are free to copy some lines ignoring the License. # Configure Data-Output types 3, 17 and 20 # and the IP where the python script is running (port 49000) in X-Plane. UDP_PORT = 49002 import socket import struct def DecodeDataMessage(message): # Message consists of 4 byte type and 8 times a 4byte float value. # Write the results in a python dict. values = {} typelen = 4 type = int.from_bytes(message[0:typelen], byteorder='little') data = message[typelen:] dataFLOATS = struct.unpack("