def time_openpyxl():
 start_time = clock()
 workbook = openpyxl.workbook.Workbook()
 worksheet = workbook.active
 for row in range((row_max // 2)):
  for col in range(col_max):
   colletter = get_column_letter((col + 1))
   worksheet.cell(('%s%s' % (colletter, ((row * 2) + 1)))).value = ('Row: %d Col: %d' % (row, col))
  for col in range(col_max):
   colletter = get_column_letter((col + 1))
   worksheet.cell(('%s%s' % (colletter, ((row * 2) + 2)))).value = (row + col)
 workbook.save('openpyxl.xlsx')
 elapsed = (clock() - start_time)
 print_elapsed_time('openpyxl', elapsed)

def time_openpyxl ( ) : start_time = clock ( ) workbook = openpyxl . workbook . Workbook ( ) worksheet = workbook . active for row in range ( ( row_max // 2 ) ) : for col in range ( col_max ) : colletter = get_column_letter ( ( col + 1 ) ) worksheet . cell ( ( '%s%s' % ( colletter , ( ( row * 2 ) + 1 ) ) ) ) . value = ( 'Row: %d Col: %d' % ( row , col ) ) for col in range ( col_max ) : colletter = get_column_letter ( ( col + 1 ) ) worksheet . cell ( ( '%s%s' % ( colletter , ( ( row * 2 ) + 2 ) ) ) ) . value = ( row + col ) workbook . save ( 'openpyxl.xlsx' ) elapsed = ( clock ( ) - start_time ) print_elapsed_time ( 'openpyxl' , elapsed )
run openpyxl in default mode .