nasa / XPlaneConnect

The X-Plane Communications Toolbox is a research tool used to interact with the X-Plane flight simulator
Other
627 stars 278 forks source link

Ported sendCOMM method from py2 to py3 #295

Open dfb opened 1 year ago

dfb commented 1 year ago

I needed to be able to send commands from Python and so I looked through some of the older tickets and found that someone had submitted a PR for it, but upon further investigation, it looks like the latest released already includes support for it in the plugin itself, and also in the python2 client, so this PR is simply adding support to the python3 client.

An example that I verified works:

import xpc
with xpc.XPlaneConnect() as client:
    for i in range(20):
        client.sendCOMM('sim/GPS/g430n1_page_dn')
        time.sleep(0.05)