iterate through a text file and write a new text file for each line python
<p>I am trying to accomplish what seems to be a simple task but I seem to be unable to figure it out. I am a Python rookie.<br></p>

<p>Here is my task:<br>
I have a text file that contains a list of numbers, each on a separate line... </p>

<pre><code>100101
100201
100301
100401
100501
100601
100701
100801
100901
101001
</code></pre>

<p>What I would like to do is read from the text file and write a new text file for each line in the file that contains the line and is also named using the line...</p>

<pre><code>100101.txt
contains one line of text "100101"

100201.txt
contains one line of text "100201"

etc...
</code></pre>

<p>Hope this makes sense...thanks!</p>

<p>hjnathan</p>
