Maybe there's an unclosed paren or quote mark somewhere before this line?

Problem:
I am using below code in python processing ,but it giving me this error
“Maybe there’s an unclosed paren or quote mark somewhere before this line?”
please tell why this error come in this.
code:

add_library(‘openkinect_processing’)

Kinect2 kinect2
def setup():
size(512, 424)
kinect2 = new Kinect2(this)
kinect2.initDepth()
kinect2.initDevice()

def draw():

background(0)

Welcome @Sourabh1801

Please use the pre-formatted button (</>) for any code that you share on the forum; this will wrap it in triple-backticks (```) so it’s properly formatted.

I don’t have openkinect_processing installed on my system, and I couldn’t test this. Your code appears translated from Java to Python, and there are some lingering Java elements. Try something like this instead –

add_library('openkinect_processing')

def setup():
    global kinect2
    size(512, 424)
    kinect2 = Kinect2(this)
    kinect2.initDepth()
    kinect2.initDevice()

def draw():
    background(0)
1 Like