Examples

The sample codes that follow will show you the basics of building pipelines. The end functionality of these is trivial, and intended mainly to illustrate concepts of MPipe. Feel free to run the examples, experiment by changing the code snippets, and use them as starting points for creating your own, more complex pipelines.

Expert techniques

All examples have links to the source code on the right side above and below each code listing. In addition, all programs are located in the test/ subdirectory of MPipe distribution.

When running the examples, keep in mind the multiprocessing nature of MPipe, especially when running interactively from the Python interpreter (e.g. cut-and-pasting into the >>> prompt) – some examples may display mangled text output, particularly in case of multiple processes simultaneously printing to stdout. For that reason, you may prefer to run the examples from your OS shell command prompt instead. If an example shows an actual command running a program, you can reproduce it by running the command from the root of the MPipe distribution (directory that contains the test/ subdirectory).