print('create by Maitri @2019.7.3')
import xlrd
book = xlrd.open_workbook('table.xlsx')
sheet1 = book.sheets()[0]
nrows = sheet1.nrows
ncols = sheet1.ncols
print('all row nums: ',nrows)
print('all col nums: ',ncols)
#row3value = sheet1.row_values(2)
#print('third row value: ',row3value)
#cell32 = sheet1.cell(2,1).value
#print('row3 col3 value: ',cell32)
dic = {}
for i in range(nrows):
name = sheet1.cell(i,0).value
if dic.has_key(name) == False:
dic[name] = 1
else:
dic[name] += 1
print(dic)
res = open('table.txt',"w")
res.write("")
for key in dic:
res.write(key+' show times : '+str(dic[key])+'\n')