title: Creating instances efficiently in Python
body: <p>So I have a program in which I need to create 4 instances of a class with variables imported from an external document. I have a solution and I have placed it below, but I want to know if there's an easier/more efficient way to do it, perhaps with a for loop.</p>
  
  <pre><code>partsLine = partsDoc.readline()
  partsList = partsLine.split(' ')
  part1 = Parts(partsList[0], partsList[1], partsList[2],)
  
  partsLine = partsDoc.readline()
  partsList = partsLine.split(' ')
  part2 = Parts(partsList[0], partsList[1], partsList[2],)
  
  partsLine = partsDoc.readline()
  partsList = partsLine.split(' ')
  part3 = Parts(partsList[0], partsList[1], partsList[2],)
  
  partsLine = partsDoc.readline()
  partsList = partsLine.split(' ')
  part4 = Parts(partsList[0], partsList[1], partsList[2],)
  </code></pre>