Copyright © 2009. All rights reserved.

Example: ComponentInterfaceExample.py

  1. This example demonstrates how to access the Component interface directly. It creates (essentially) the same data flow that we created for the simple HelloWord component but rather than using the DataFlow class, we’re building and connecting things manually. In most cases you should never need to handle these things manually but nevertheless, if the need arises, you can take complete control of things as shown in this example.

Produces the output:


  1. Creating HelloWorld() component

  2. This component has these default input ports: ['in']

  3. This component has these default output ports: ['out']

  4. Adding new output port "test1" to HelloWorld component...

  5. This component now has these output ports: ['test1', 'out']

  6. Description for port "in" --> Default input port

  7. Description for port "test1" --> this is where the port description would go

  8. Description for port "out" --> Default output port

  9. HelloWorld does not contain a port called "test2"

  10. Connection status for HelloWorld port "out": False

  11. Connecting ports now...

  12. Connection status now for HelloWorld port "out": True

  13. Sending some test data...


  14. Hello Tom

  15. Hello Dick

  16. Hello Harry