It is possible to interact with ICU via process communication. An external (Python) process can communicate with ICU via events and a shared memory object.

Inter-process Communication

TODO - for now see the file test/test_external.py for details.

Shared Memory

ICU exposes a shared memory object (implemented using process pipes), which other processes may read. The shared memory is created automatically with process, memory = icu.start(). it exposes the following attributes which can be accessed in the usual way (e.g. memory.event_sinks).

  • event_sinks - a list of event sink names, these are valid destinations for any events that be generated by another process.
  • event_sources - a list of event sources, the sources of events that another process may receive from the ICU process.
  • window_properties - a dictionary of sizes and positions of the various widgets in the ICU window’s coordinate system, as well as the window size and position in the screen coordinate system.
  • config - the ICU configuration options that were specified in the config.json file.

Accessing the shared memory will block until ICU has completed loading. The shared memory object is not bi-directional (read only), its purpose is to expose various useful properties of the ICU system to external processes.

More information on the way.

For now, see this example.