add __name__ == __main__ conditional to end of script
replace os module with subprocess module
add shell=True param to subprocess calling wc
add shell=True to subprocess calling cat
use subprocess.Popen to get wc -l and then manipulate the resultant string to just contain the linecount