#NEWLINE# def write_to_csv( self , context , csv_table_list ) : #NEWLINE# #INDENT# self . test_file = os . path . join ( context . output_directory , 'table_results.csv' ) #NEWLINE# csv_file = open ( self . test_file , 'w' ) #NEWLINE# wr = csv . writer ( csv_file , delimiter = ',' ) #NEWLINE# index = 0 #NEWLINE# for element in csv_table_list : #NEWLINE# #INDENT# if element : #NEWLINE# #INDENT# if ( index == 1 ) : #NEWLINE# #INDENT# element . insert ( 0 , '0' ) #NEWLINE# #UNINDENT# index += 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# index = 0 #NEWLINE# #UNINDENT# #UNINDENT# for item in csv_table_list : #NEWLINE# #INDENT# wr . writerow ( item ) #NEWLINE# #UNINDENT# csv_file . close ( )