title: Python, Read from txt file and split data
body: <p>This is a programming exercise that I am working on.</p>
  
  <p>So I have this text file (.txt) with lines that look something like this:</p>
  
  <pre><code>'X', ['X', 'a', ... , 'b'], 'There should be 5 of X in this vector'
  </code></pre>
  
  <p>And what I want is to define a function that reads this data into python line by line and send each line back as three variables, for this specific line above I want the function to send back this:</p>
  
  <pre><code>var = 'X'
  vek = ['X', 'a', ... , 'b']
  strng = 'There should be 5 of X in this vector'
  </code></pre>
  
  <p>this is how far i've got</p>
  
  <pre><code>def reading(file, linenumber):
  
      text = open(file, 'r')
      data = text.readlines()
  
  
      return something
      text.close() 
  </code></pre>
  
  <p>When I have red this into python I want to use this returned data in a code that "counts how many times the variable (var) are repeated in the vector/list (vek) and then print out that number to see if it agree with the statement (strng). I think I can handle this last part, I just need some help with the reading and splitting.</p>
  
  <p>Also I want to say that I am really new into python, I saw my first code for like 2 weeks ago. I have however done abit MATLAB so I am familiar with for, while, if-elif-else and I understand some basic programming. I am using 2.7 version.</p>
  
  <p>Please have some patience with me :)</p>