Examples for 'Getting started with Processing.py' book

Hi,

I’m new to programming and bought the book Getting started with processing.py. All code in the book works but when I open the examples they are coded for java. I’ve searched but can’t find the same examples for python mode.

Do they exist or do I have to manually type the code in or replace the commands that I know are different?

1 Like

There are plenty of worked examples out there, I even created some myself, there is also a processing.py fork of the Nature of Code Examples. However you could learn a lot by translating the java code examples yourself.

2 Likes

Open PDE, and then switch the blank sketch into Python Mode with the dropdown menu. Now when you open the Examples window you will find the Python examples. For example, the top folder with be “Advanced > KeyCodes”.

You can also find these examples in your file system under

Processing > modes > Python > examples

If you have not yet installed Python Mode, do it with Contributions Manager and it will be available in the new blank sketch dropdown. You cannot switch an existing sketch between modes – only a blank sketch.

1 Like

Hit CTRL + N to open another “blank” sketch window. We can change between modes from there. :wink:

P.S.: If we define custom sketch templates, a “blank” sketch window isn’t necessarily blank btW. :stuck_out_tongue:

1 Like