title: Reading in from a file and drawing
body: <p>The problem I am having involves reading in from a file, and using python's turtle to draw shapes based on what is read in.</p>
  
  <p>The text file looks like this (but no spaces in between the lines):</p>
  
  <p>r 0.0 200.0 50.0 100.0 blue</p>
  
  <p>c 0.0 200.0 40.0 red</p>
  
  <p>p 0.0 200.0 3 40.0 black</p>
  
  <p>the problem is going from a line in the file to something like
  r = Rectangle(0.0,200.0,50.0,100.0,"blue")</p>
  
  <p>if the line starts with a "r", use my Rectangle method, if its starts with a "c" use my Circle method (or "p" use Polygon())</p>
  
  <p>I have all the shape methods down I just don't know how to get it from the file to say draw a rectangle(or circle/polygon) at these coordinates with these side lengths and this color. This is what I have so far, but it seems too complicated and is getting messy. Any help or ideas are appreciated, thanks.</p>
  
  <pre><code>shapeCollection=[]
  with open(name,"r") as f:
      for line in f:
          for i in line.split():
              shapeCollection.append(i)
  print(shapeCollection)
  for each in shapeCollection:
      if each == "r":
          #(xCor) = each+1
      elif each == "c":
          #
      elif each == "p":
          #
  </code></pre>