Intro to Processing

Processing Progress
1%

Introduction

Welcome to the next part of Intro to Code. In the Processing section, we’ll introduce you to a graphics library built on Python called Processing. By the end of this section, you’ll be able to apply all of the programming skills you learned in Reeborg, Intro to Code A and Intro to Code B lessons to build a full-scale game, Pong or Flappy Bird.

Setting up Processing

To set up Processing on your computer, follow the steps below.

  1. Go to: https://processing.org/download/.
  2. Download Processing (it is free). Choose the most recent version that is compatible with your computer.
  3. Restart your computer, if necessary. Open Processing.

Enable Python in Processing

Processing doesn’t include support for the Python programming language by default. In order to enable Python support, you’ll need to install an add-on called Python Mode. You can do this by clicking on the drop-down menu on the right side of the tool bar and selecting “Add Mode…” A window with the title “Mode Manager” will appear. Scroll down until you see “Python” and press “Install.”

Now, open a sketch file. If one is already open, you can use that.

Change the language in the dropdown located at the top right corner to Python. Make sure Java (the default) is NOT the selected language. Once you do this, the language should be set to Python in all future new sketch files. Your new sketch file should like like this.

You should write your code directly into the white text area of the sketch file. You can run your code using the “play” button (shaped like a triangle) at the top. You can stop running your code using the “stop” button (shaped like a square) at the top. It’s similar to the Reeborg interface!

Start Coding in Processing

Let’s start coding! To get started, we’ll write some code to initialize the background.

size(500, 500)
background(0, 0, 0)

Now, run your code with the “play” button. You should see something like this.

If you see this, you’re good to go! If not, please check in with a teacher or mentor before moving on.

Lesson Sequence

Here is an overview of the lessons we’ll cover in Processing. You can navigate to the lessons using the buttons below, using the bottom right corner buttons on each page that will take you to the next lesson, or using the horizontal navigation menu at the top of the website.

Processing Documentation

In Intro to Code, we want to equip you with the skills to become a professional software engineer (if you want to!). So, we’ll also share with you the official documentation on Processing in Python, put together by the creators of Processing. Feel free to read through it or use it as a resource throughout these lessons to learn more about the functions available in Processing in Python.

See documentation here: https://py.processing.org/reference/.