Why simple drawLine between two cubes not work?

I thought I copied the following simple script correctly, but it doesn’t draw a line between the two cubes; I assume I’ve made an obvious mistake, but as a nube to Blender and Python, I don’t see it.

import Rasterizer as r
import GameLogic as g
own = g.getCurrentController().owner
objects = g.getCurrentScene().objects
pointA = own.position
pointB = objects("OBpointB").position
color = (0,0,1)
r.drawLine(pointA, pointB, color)

(edit): told you I’m nube, don’t yet know Python conventions, of course it should be:
pointB = objects[“OBpointB”].position

In my defense, the youtube I got the script from was blurry, & I couldn’t tell the difference between parentheses and brackets on my screen; & even error line number didn’t clue me in enough.


drawLineTwoCubes1x.blend (133 KB)

Look in the consol, it write that you have a fault in line 9.
The fault is that objects is a list so you must use [] instade ().
pointB = objects[“OBpointB”].position

Thanks, I did know where (what line) the error was, but don’t know Python yet so I didn’t recognize the wrong syntax; the youtube I got if from was so blurry on my screen, I thought the brackets were parentheses, until it finally dawned on me that maybe they weren’t.