Divide values divided by tab, in their own variable
<p>I create an output file in a different process, which has 2 values with a tab separating each other. Each line has 2 values and newline, so you always have 2 values per line.</p>

<p>I would like to get the first and second value in 2 different variables, and use them; but I am having hard time to split them.</p>

<p>I do not know the lenght of each string, I just know that there is a tab in between, so I can't count the characters and slice. How do you accomplish this in Python?</p>

<p>Assuming all your lines are stored in a list called <code>my_lines</code> you can do:</p>

<pre><code>for line in my_lines:
  val1, val2 = line.strip().split("\t", 1)
</code></pre>

python file split