Closed
Description
Most appropriate sub-area of Processing 4?
Other (specify if possible)
Processing version
4.4.1
Operating system
Ubuntu 24.04.2 LTS GNOME
Steps to reproduce this
The following code in the image fails at Line 20, in Processing 4.4.1 using Python Mode for Processing 4 4001.
It's just a simple class.
Is Python 3 supported in Processing 4.4.x and higher?
Thank you,
MB
snippet
// Paste your code below :)
def setup():
size(400,400)
background(255)
def draw():
background(255)
fill(0, 102, 153)
ellipse(mouseX, mouseY, 50, 50)
class Rectangle:
def __init__(self, width, height, color):
self.width = width
self.height = height
self.color = color
def area(self):
return self.width * self.height
def display_info(self):
print(f"Width {self.width}, height {self.height}, and color {self.color}")
rect1 = Rectangle(10,5,'red')
rect2 = Rectangle(8,4,'blue')
print(rect1.width)
print(rect2.color)
Additional context
Seems to fail on that print() statement.
It seems to work as a regular python script, outside of
processing but just in case, am I doing something wrong?
Would you like to work on the issue?
No. I don't know how to fix this issue.