Advertisement
Guest User

Untitled

a guest
Sep 8th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1.     def setup(self):
  2.         temp = []
  3.         filename = open('num.txt', 'r')
  4.         for line in filename: # goes through every line in the file
  5.             row = line.strip() #strips the white space around it.
  6.             temp.append(row) # adds it to the list
  7.  
  8.         for i in range(0, len(temp)):  # for i in range(0, to the length of the list)
  9.  
  10.             self.data.append(temp[i].split())  # adds it to a new data set
  11.  
  12.         for i in self.data:
  13.             matrix = Matrix([[float(i[0]), float(i[1])]])
  14.             self.matrices.append(matrix)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement