Create a xls file from a dict python
Question: Anyone knows how to create a xls file from a dict? I have a dictionary filled
with words in a text, i want to put this DICT in a xls

    
    
    def contar_Repetidas(texto):
        dic={}
        l=texto.split()
        for palabra in l:
            if palabra not in dic:
                dic[palabra] = 1
            else:
                dic[palabra] +=1
        return dic
    

It's diferent becorse, i want to create a MS Excel from a DICT, a DICT


Answer: Using the [`xlwt`](https://pypi.python.org/pypi/xlwt) module:

    
    
    import xlwt
    
    dic = contar_Repetidas("Some Text Here")
    
    wb = xlwt.Workbook()
    ws = wb.add_sheet("Your Sheet")
    
    count = 0
    for word, num in dic.items():
        count += 1
        ws.write(count, 1, word)
        ws.write(count, 2, num)
    
    wb.save("/Path/To/Save/Example.xls")
    

