Processing vs Processing Py

Hello,
I’ve been using Processing on and off for a number of years. I’ve also played around with P5 JS so I know what to expect from that platform.

As it happens I am also a Python programmer though my Python programming has been limited to data processing applications.

My question is for Processing Py users who started out using straight Processing and subsequently migrated to Processing Py. I’d like to know what has your experience been migrating to Processing Py? Was there a significant learning curve? What were your biggest challenges? What do you see as being the benefits of Processing Py over standard Processing?

Thanks in advance. Your answers will help me to decide whether or not I should consider migrating to Processing Py.

Jim

1 Like

I started with Processing years ago (before Processing.py), which inspired me to explore various creative coding environments.

Was there a significant learning curve?
It’s Java Processing with Python syntax. Same functions, features, etc. If you already know Processing and have some Python experience, I’d say it’s simple to switch. I’d recommend reading this: https://py.processing.org/tutorials/python-jython-java/

What were your biggest challenges?
I’ve had some issues with the compatibility of certain Processing libraries. Also, Jython has it’s limitations (no libraries with a C extension). Generally speaking, I’ve been able to work around these issues.

What do you see as being the benefits of Processing Py over standard Processing?
I prefer Python to Java/JS. Processing is popular for teaching and Python is a great language for first-time programmers, so Processing + Python seems an ideal combo.

3 Likes

Thanks for your insights.

In going through the page you reference, the biggest issue I have is that Jython is still running as Python 2.7. It’s worth pointing out that Python 3 was introduced over 10 years ago and is currently at version 3.9. Also, Python 2.7 end of life was 1/1/2020. FYI, a nice python versions release chart is here: https://python-release-cycle.glitch.me/

So I think I’ll hold off on any Processing PY until such time as Jython supports Python 3.x

Python mode comes with one set of limitations: it is Jython, so no C/compiled libraries and Python 2.7 syntax only. Most (but not all) of the Processing Java library ecosystem is available, however it is not documented in Python, so understanding how to use it may require being code-bilingual. This isn’t a big deal, this just means that for learners it is better for intro projects and then advanced – the “intermediate” level can be a bump ride, because as soon as you start trying to build things with multiple / non-standard libraries there is more potential complexity. Still, I really enjoy using it and teaching with it.

There are number of other Processing with Python options – both desktop/command-line and python+JavaScript web embedded. Because these attempt to recreate the API rather than accessing it through Java, they are much more limited and don’t have the library ecosystem.

RE: waiting: Be aware that waiting for Jython3 may be a long, long wait, and even then it isn’t necessarily the case that Python mode will be immediately updated to use it.

2 Likes

Yes. But Jython maintains compatibility with Java, so there are no issues with Python 2.7 working in Processing.

I teach creative coding with Processing Python (2.7) mode, then shift to other Python (3) environments for doing Web and other Python development. My students don’t realize the switch, because:

  • I always include object in my class definitions:
    class Dog(object):
    instead of
    class Dog():

  • I make explicit use of floating points for division operations:
    5 / 2.0
    instead of
    5 / 2

There are other Python-2-vs-3 caveats. You’re probably writing pretty advanced code if you encounter these things, so you won’t have trouble working around them. But, then, maybe you have particular Python 3 features you require.

Processing ‘Java’ mode is different from real Java, but the developers decided this was better for Processing. Processing.py is Python 2.7, but I prefer to Java mode. I guess it’s down to personal preference and what you need to accomplish.

2 Likes