title: Python - read numbers from text file and put into list
body: <p>So like the title says im starting to learn some python and im having trouble picking up on this technique.  What I need to accomplish is to read in some numbers and store them in a list.  The text file looks like the following:</p>
  
  <pre><code>0 0 3 50
  
  50 100 4 20
  </code></pre>
  
  <p>Basically these are coordinates and directions to be used for python's turtle to make shapes.  I got that part down the only problem is getting them in a correct format. So what I can not figure out is how to get those numbers from the file into <code>[ [0, 0, 3, 50], [50, 100, 4, 20] ]</code>
  A list, with each four coordinates being a list in that one big list.</p>
  
  <p>Heres my attempt but it as I said I need some help - thank you.</p>
  
  <pre><code>polyShape=[]
  infile = open(name,"r")
  num = int(infile.readline(2))
  while num != "":
      polyShape.append(num)
      num = int(infile.readline(2))
  infile.close()
  </code></pre>