newbie question about dictionnary ?
johnagianis at yahoo.com
Fri Sep 5 15:07:07 CEST 2003
"Sophie Alléon" <alleon at club-internet.fr> wrote in message news:<3f582f90$0$20952$7a628cd7 at news.club-internet.fr>...
> I do numerical simulation for which I have to process mesh. A mesh is made
> triangle which are made of points.
> I want from this information to create edges and build triangle from edges
> than from points.
> An edge is shared by possibly more than one triangle.
> have a triangle class (made of 3 edges)
> have an edge class (made of 2 points and embeding a triangle list (those
> connected to the edge)
> for each triangle construct its edges but I have to check if the edge
> already exists
> for doing this I thought the dictionary was excellent but the key is a
> string while I want it
> to be the 2 points forming the edge ? How to do it ?
> Have you a better idea ?
Dictionary keys are not necessarily strings. It can be even class
instances!! You can have the following:
Well i think that a list would be ok. The use of a dictionary is for
making a relation (key->value).In this case i dont know what the value
More information about the Python-list