Python - Import file into NamedTuple
<p>Recently I had a question regarding data types.<br>
Since then, I've been trying to use NamedTuples (with more or less success).  </p>

<p>My problem currently:<br>
- How to import the lines from a file to new tuples,<br>
- How to import the values separated with space/tab(/whatever) into a given part of the tuple?  </p>

<p>Like:  </p>

<pre><code>Monday  8:00    10:00   ETR_28135   lh1n1522    Computer science    1     
Tuesday 12:00   14:00   ETR_28134   lh1n1544    Geography EA    1  
</code></pre>

<p>First line should go into tuple[0]. First data: tuple[0].day; second: tuple[0].start; ..and so on.<br>
And when the new line starts (that's two TAB (\t), start a new tuple, like tuple[1]).  </p>

<p>I use this to separate the data:  </p>

<blockquote>
<pre><code>with open(Filename) as f:
    for line in f:
        rawData = line.strip().split('\t')  
</code></pre>
</blockquote>

<p>And the rest of the logic is still missing (the filling up of the tuples).  </p>

<p>(I know. This question, and the recent one are  really low-level ones. However, hope these will help others too. If you feel like it's not a real question, too simple to be a question, etc etc, just vote to close. Thank you for your understanding.)</p>
