@Dou wrote:
Hi all,
I am working on a quite straightforward python script which is supposed to create a .xls file and write something in it. I run this script in both RhinoPython and GHPython, but got following error:
Message: sequence item 0: expected bytes or byte array, str found Traceback: line 86, in get_biff_record, "C:\Users\XXXXXXX\Downloads\xlwt-1.1.2\xlwt\BIFFRecords.py" line 622, in _Workbook__sst_rec, "C:\Users\XXXXXXX\Downloads\xlwt-1.1.2\xlwt\Workbook.py" line 696, in save, "C:\Users\XXXXXXX\Downloads\xlwt-1.1.2\xlwt\Workbook.py" line 6, in <module>, "C:\Users\XXXXXXX\AppData\Local\Temp\TempScript.py" line 660, in get_biff_data, "C:\Users\XXXXXXX\Downloads\xlwt-1.1.2\xlwt\Workbook.py"
Here is my script:
import xlwt wb = xlwt.Workbook() sheet = wb.add_sheet("TestSheet") sheet.write(0,0,'Hello') wb.save("Test.xls")
The last line
wb.save("Test.xls")
triggers error. This script runs well in other environment like cmd and Aptana Studio.. I wonder is there any problem with settings or installation?Thanks,
Dou
Posts: 3
Participants: 2