Class and Array Problems
<p>I am absolutely useless with python and I'm struggling to do what seems to be simple things.
I need to read a text file which contains a network routing table which contains the distance between each node on the network (below)</p>

<pre><code>0,2,4,1,6,0,0
2,0,0,0,5,0,0
4,0,0,0,0,5,0
1,0,0,0,1,1,0
6,5,0,1,0,5,5
0,0,5,1,5,0,0
0,0,0,0,5,0,0
</code></pre>

<p>I then need to assign it to a two dimensional array which I have done with the code i have written below..</p>

<pre><code>Network = []
NodeTable = []
def readNetwork():
    myFile = open('network.txt','r')
    for line in myFile.readlines():
        line.strip(' \n' '\r') 
        line = line.split(',')
        line = [int(num) for num in line]
        Network.append(line)
</code></pre>

<p>Once that has been done I then need to iterate through the Network array and add each horizontal line to another array  which will hold information about the nodes, but as far as I have been able to get with that is here:</p>

<pre><code>class Node(object):
     index = #Needs to start from A and increase with each node
     previousNode = invalid_node
     distFromSource = infinity
     visited = False


NodeTable.append(Node())
</code></pre>

<p>So that array will be initialised as:</p>

<pre><code>A  invalid_node  infinity  False
B  invalid_node  infinity  False
C  invalid_node  infinity  False
...
etc
</code></pre>

<p>Could anyone give me a hand with creating each node in the NodeTable array?</p>
