thanks for helping me out josephh.
The function run is from p5. I guess it calls setup and then runs the draw loop. nothing happens without the run command.
Brilliant suggestion for fixing the error. I thought I’ve checked everything but I forgot the position should be a vector.
So in the show() method this fixed my error:
circle(0,0,self.r) --> circle((0,0),self.r)
So this is the full working class:
class class_circle:
def __init__(self, r):
self.r = r
def show(self):
fill(255)
circle((0,0),self.r)
ty @josephh. I’m usig p5py. As I understood proccesing.py is only python2.7 doesn’t let me import whatever python package I want in my own editor.
@tabreturn ty. If I ever learn how to contribute to a package I would love to make pyp5 return an error code like “First index should be tuple, not scalar”
Than you for this solution @jeremydouglass. I’m new to devloping python packages. Why not add these helpful error message in the main package? To me it seems helpful - but I would love to know what an experienced developer thinks
It would be helpful, I agree! The only reason I can think of not to would be if the extra error handling incurred a performance hit – or if the method could be made smarter by handling non-tuple arguments correctly in line with the other APIs, in which case that error message would no longer make sense.
There is currently a proposal to do that here:
edit
But you could also open a PR with proposed error messages instead / in the meantime / as well.