What's Wrong With the Script

Hi. Can some one tell me what’s wrong with this script?
(I trying to learn Python, and this is my first try at it and the script is based on a tutorial found at
http://jmsoler.free.fr/didacticiel/blender/tutor/english/python_script01.htm)

http://upload.phyrenet.com/files/index.php?path=&download=script.zip

thanks

I guess you are tryin to make a grid…

There’s a lot of silly things to start with.
The I gave up.


me=NMesh.GetRaw()
i=0 #you really don't need to initialise these
j=0

totalvert = 9
n = sqrt(totalvert) #this should really be cast to an integer here

for i in range(0, n, 1): # range(n) is sufficient
	for j in range(0, n, 1): # range(n) is sufficient
		v=NMesh.Vert(j, i, 0.0)
		me.verts.append(v)

n0=int(n)

for i in range(0, n-1):
	for j in range(0, n-1):
		f=NMesh,Face()
		f.v.append(me.vert[i*n0+j] # missing )
		f.v.append(me.vert[i*n0+j+1] #and here
		f.v.append(me.vert[(i+1)*n0+j+1] # and again
		f.v.append(me.vert[(i+1)*no+j] # the var is called n0 not no
		me.faces.append(f)
		
NMesh.PutRaw(me, "plane", 1)
Blender.Redraw()

BTW if you want to learn Python then buy a book.
O’Reilly has at least 2 excellent titles, you’ll save
yourself a lot of time and you’ll learn genuine
Python coding idioms.