I Can Program logo

SIMPL Programming for Python

Introduction

What is SIMPL?

SIMPL is an acronym that originally stood for Synchronous Interprocess Message Passing for Linux.

We felt that synchronous message passing was such an important tool that we have developed libraries in a number of different languages to perform this type of interprocess messaging.

Before continuing, the following assumptions have been made:

  1. you are running a functional Linux distribution (or others listed above)which supports C and Python programming,
  2. you have some familiarity with C programming,
  3. you have some familiarity with the Python language.

In addition the authors of this course have recently published a book on the SIMPL toolkit. That book includes several examples of using Python in SIMPL applications. It can be found at : SIMPL Book

I Can Program logo

Programming the SIMPL Way

What is this course about?

This course is about learning the basics and uses of SIMPL within Python scripts. In this way Python programs can communicate via SIMPL with other network connected programs that also support SIMPL. To date, SIMPL libraries/modules exist for programs written in C, Tcl, Java, and Python running on Linux, Unix, QNX, and MAC OS X platforms. In this course we only show SIMPL communications between Python scripts and C programs.

What is equally important is what this course is not about. It is not a course on how to program in Python or C. Nevertheless, we will go over certain aspects of Python as they relate directly to the usage of SIMPL but expect some familiarity with C. Note the C/SIMPL course also offered.

Another important point is that SIMPL is compatible with Python versions > 2.5 and >= 3.0. The SIMPL module(s) have been written in such a way that whichever Python interpreter is called, the correct SIMPL module will be imported. Moreover, the course scripts are compatible with versions > 2.5 and > 3.0. So, please feel free to use whichever Python interpreter you are most comfortable with.

Why Python?

We are not going to get into the debate of what languages are better than others and so on. It suffices to say that each language has its strengths and weaknesses much like any tool. However, this course is about Python SIMPL and here is why we wrote a SIMPL module for Python:

We recommend that you read the document called readme.Python which is located in the docs directory below the SIMPL root directory. This doc contains a discussion of the reasoning, history and philosophy behind Python SIMPL.

We are using what is now known as CPython. That is, Python written in C/C++ as opposed to JPython (or Jython) which has been written in Java. The code that you will use has been run successfully on versions Python2.5 through Python3.3.

For graphics capability, we are using the Tk toolbox via Python's Tkinter (versions 2.*) or tkinter (versions 3.*) module.

What is covered by this course?

Necessarily, we are going to run and examine some programs. The aim is to show how pairs of SIMPL programs operate:

Python text-based and Python graphics-based refer the user interface of the Python scripts.

All of the programs have been written for you but you are encouraged to modify them and experiment.

We will be promoting the concept of tokenized message passing in all cases. There are exactly three different messages that are sent and received throughout all of the lessons. Each message uses a token as an identifier. The messages are kept the same throughout all of the lessons in order to maintain some continuity. Each message contains different data types in order to demonstrate how these various data types may be used to exchange information between the various senders and receivers.

There is a large amount of repetition of the programs between the various lessons. This can be viewed as an example of the versatility of SIMPL programs in the sense that any SIMPL program can communicate with any other SIMPL program on any other supported platform and written in any other SIMPL supported language. The messages are always the same and there are always one sending program and one one receiving program for the sake of simplicity in lessons 2-5 in order that other basic details may stand out more clearly.

Summary

Let's summarize what you have read so far.

End of Introduction.

Copyright of iCanProgram Inc. 2003,2009,2013