def make_table_file(lines, labels, dir_path, filename):
 lines.sort()
 lines.insert(0, ' DCTB '.join(labels))
 output = open(os.path.join(dir_path, filename), 'w')
 output.write('\n'.join(lines))
 output.close()

def make_table_file ( lines , labels , dir_path , filename ) : lines . sort ( ) lines . insert ( 0 , ' DCTB ' . join ( labels ) ) output = open ( os . path . join ( dir_path , filename ) , 'w' ) output . write ( '\n' . join ( lines ) ) output . close ( )
generic table writer .