<p>
In episode <a href="https://www.thebadapples.info/index5.html">5X18 of the Bad Apples</a> podcast, Klaatu challenged me to create my own podcast 
explaining my Python version of his bash script. His bash script created a list of
files that matched a file name pattern, then read the first line from each of those files
and wrote that to an output file. My Python program does exactly the same thing, but in Python.<br />
Here is the body of that program with the comments stripped out:</p>
<pre>
#!/usr/bin/python
import glob
outfile = open("toc.output", "w")
for filename in glob.glob("*.txt"):
    outfile.write(open(filename).readline())
</pre>
<p>
The above text can be used to follow along with the audio of the podcast. Here is the English explanation 
version of the above program:<br />
<ul>
<li>Tell the system the rest of the text in the file should interpreted by Python</li>
<li>Import the glob module, which is one of the library modules that comes with Python</li>
<li>Create a new file object called "toc.output" that we can write to</li>
<li>Iterate over the list of files that match the pattern "*.txt" created by the glob function, and assign each matching file in turn to the filename variable</li>
<li>Open each filename, read the first line from the file and write it to our previously opened output file.</li>
</ul>

It's not shown above, but each matching filename that we open is closed at the end of the looping construct. 
In addtion, the output file is also closed at the end of the programs execution.
<br />
Hopefully you enjoyed the podcast!
</p>