Parse text file function
As a recommendation for readability i suggest you replace

if len(tempList) &gt; 0:


with

if tempList:


as the Empty List resolves to False.

It's also recommended to use the "with statement" when dealing with files to avoid errors.

with open('file') as f:
   ...


This will free any locks on the filesystem once this block is exited.