bug in the previous code so the final code should be:
 
import xlwt
"""Reads robert.txt
This is the final script that writes by incrementing each row but maintain
one column"""
  
# Create workbook and worksheet 
wbk = xlwt.Workbook() 
sheet = wbk.add_sheet('python')
row = 0  # row counter
f = open('robert.txt')
for line in f:
    L = line.strip()    
    print L
    for c in L:
        print c
        sheet.write(row,0,c)
        row += 1
    
wbk.save('reformatted.data.xls')
 
_______________________________________________ Tutor maillist - 
Tutor@python.org To unsubscribe or change subscription options: 
http://mail.python.org/mailman/listinfo/tutor                                   
 
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to