2.2 The Processing Environment

A development environment is a piece of software that helps programmers write computer code. For this class, we will be using a development environment called Processing. Processing makes our lives as programmers easier in a variety of ways. For instance, just as a document editor like Microsoft Word can recognize spelling mistakes and bring them to your attention, Processing recognizes Python keywords and other programming constructs. It can highlight them in different colours, making our code easier to read and write. Telling the computer to run your code in Processing is as simple as pressing the “Run” button that appears directly above the coding window. Processing also gives us a console where your program can print any text-based output, as well as a separate window called the canvas for displaying simple graphics or pictures that your program might draw. All of these things are just conveniences for us. There’s no reason we couldn’t write our Python code in a plain text editor like Notepad1 and then later tell the computer to run it, but by using Processing, we have everything we need all in one place.

Processing goes a little beyond other development environments in that it expands the Python language a bit by adding some new commands that don’t normally exist in plain Python. For instance, Processing allows us to create simple visual output, such as lines and shapes, often with only a single command. Without the Processing environment, doing these sorts of things using Python is still possible, but more complicated. The downside to using the Processing environment is that it’s a bit tricky for novices to tell where basic Python stops and the extra functionality provided by Processing begins. Throughout these readings, we’ll try to point out the distinction where we can, but ultimately it’s not all that important for the moment anyway. Our goal here is to learn the fundamentals of programming, not to learn every possible detail of a specific language or tool.


1 Never use a document editor like Microsoft Word to write code. Document editors often sneak invisible formatting commands into your document, which will mess up your code when the computer tries to run it.