i am started to learn Python. I found Dijkstra's Algorithm in german language and try execute the functions in different class as shown below.
Knoten: nodes Kanten: edges Nachbar : neighbour kantenZuNachbarn : edges to neighbour refStartKnoten : start node refZielKnoten: end node
**# Autor: kb **# Datum: 15.07.10
from xml.dom.minidom import
class Knoten(object):
def __init__(self, nameKnoten):
self.name = nameKnoten
self.kantenZuNachbarn = []
self.daten = []
def addNachbar(self, refKante):
self.kantenZuNachbarn = self.kantenZuNachbarn + [(refKante)]
class Kante(object):
def __init__(self, refStartKnoten, refZielKnoten):
self.startKnoten = refStartKnoten
self.zielKnoten = refZielKnoten
self.daten = []
Her is what i try to do:
#obj of class knoten
k1 = Knoten('A')
k2 = Knoten('B')
#obj in class Kante
kante1 = Kante (k1,k2)
After i created the object, i try to get the attribute of this object by executing following code
kante1.startKnoten
This is what i get from executing the code above. What does that mean? What did i do wrong? <graph_dijkstra.Knoten at 0x1d42a2dd148>