- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 1
5 Posted Topics
Hey, I have a function, though it's not working as it should be. My program is Dijkstra's algorithm, and I am trying to build a list of a node's nearest neighbours using info contained in a text file of the network (7 nodes in this case), in the form: 0,2,4,1,6,0,0 … | |
Hello, I have some code that passes arguments between functions, though I am failing to understand why my code isn't working. This is the relevant section of my Dijkstra's algorithm code: [CODE]def network(): f = open ('network.txt', 'r') network = [[int(node) for node in line.split(',')] for line in f.readlines()] print … | |
Hello, I am having some trouble in working out the distance of each node from the starting node in my Dijkstra Algorithm code. Here is my code with the section i'm stuck on in bold: [CODE]infinity = 1000000 invalid_node = -1 startNode = 0 class Node: distFromSource = infinity previous … | |
Hello, I am stuck on how I have pass function arguments to the main method of my program. Here is my code: [CODE]network = [] def populateArray(): file = open('C:\\My Documents\\route.txt', 'r') for line in file: network.append(line) print "Network = " print network def main(): if __name__ == "__main__": main() … | |
Hello, I am in the middle of implementing a TFTP client using python though I have come unstuck on a client timeout feature. I am trying to implement the following feature, quote taken from the RFC: "If a packet gets lost in the network, the intended recipient will timeout and … |
The End.