In episode 5X18 of the Bad Apples 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.
Here is the body of that program with the comments stripped out:
#!/usr/bin/python import glob outfile = open("toc.output", "w") for filename in glob.glob("*.txt"): outfile.write(open(filename).readline())
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:
Unless otherwise stated, our shows are released under a Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.
The HPR Website Design is released to the Public Domain.