使用xlwt在Python中保存工作簿会给出错误

近来这个问题已经发生了很多。 当我运行这个代码:

import xlwt wb = xlwt.Workbook() sheet = wb.add_sheet("Random") sheet.write(0,0,"hello!") wb.save("test.xls") 

它给了我错误:

 Traceback (most recent call last): File "<module2>", line 16, in <module> File "C:\Python27\lib\site-packages\xlwt\Workbook.py", line 662, in save doc.save(filename, self.get_biff_data()) File "C:\Python27\lib\site-packages\xlwt\CompoundDoc.py", line 261, in save f = open(file_name_or_filelike_obj, 'w+b') IOError: [Errno 13] Permission denied: 'test.xls' 

我寻找答案,但我找不到它。 任何帮助将不胜感激!