[Tutor] subscript problem
Jimmy verma
jim_938@hotmail.com
Wed Jun 4 07:22:01 2003
class AB:
> def __init__(self):
> self.n_p = None
> self.po = Vec() # in c struct this is Vec* po
> self.con = [] # in c struct this is short* con
>
>
>class Vec:...
>def XYZ(out):
> n = 0
> out.con.append(5)
> last = out.con[n]
So last now equals 5 after the first call.
> v_start = out.po[last]
>Can you explain in words what you are trying to do with
>Vec, AB etc?
I am having some curves, whose points i am trying to store with Vec and AB.
With AB i have no of points (n_p), coordinates (x,y) with Vec and curves are
taken with (con). Like con[0] is the first curve and con[0] + 1 is the
second curve and so on...
Like a particular curve has some points and those point's coordinates are
handled with 'po'.
>Maybe we can find a more Pythonic way of doing it?
>Alan G.
_________________________________________________________________
HCL Beanstalk PCs. You could win one.
http://server1.msn.co.in/sp03/hclbeanstalktour/index.asp Interested?