not recognised function

i’m trying to run this code as independant in a file


conv = 2*math.pi/360
localScene = Scene.GetCurrent()
 
matRed = Blender.Material.New('matRed')
matRed.rgbCol = 1,0,0
 
size=5
mesh2 = Mesh.Primitives.Cube(size)
redMesh = Mesh.Primitives.Cube(size)
redCube = makeCube(-5,7,"redCube",redMesh,localScene)
redMesh.materials = [matRed]
 
def makeCube(x,y,name,passedMesh,passedScene):
 ob = Object.New("Mesh",name)
 ob.LocX=x
 ob.LocY=y
 
 ob.link(passedMesh)
 passedScene.link(ob)
 return ob
 
 

but i get an error on makecube function

why is it not recognised?

note: this little s ript is working inside another function in another sript
so don’t understan why the called funtin is not being recognise?

any help appreciated
Thanks