Python bridge example

Hi Chris and Dave,

Is there an example python script to use with the Python bridge? I am able to import mworks.conduit from /Library/App Support/MWorks/Scripting. I am able to create and destroy conduits, and the various tests (in Core/Communications) run. However I haven’t been able to get events from the server stream. A working example would take care of all my questions.

Hey Mark,

This is actually my first time using the Python bridge, but I’ve managed to put together a working example (attached) that reports #announceStimulus events.

Note that you’ll need to set MWClient to launch in 64-bit mode in order for the Python bridge to work. This is because the bridge always launches Python as a 64-bit process, and the two processes need to be of the same architecture in order for the IPC to work. (I’ve fixed this in the latest nightly build so that the bridge launches Python with the same arch as MWClient.)

Let me know if you have any problems.

Chris

Attachment: python_bridge_example.py (598 Bytes)

Excellent, thank you!! I think the 32/64-bit mismatch was my problem.
I’ll look at this in the next few days in the nightly.

M