|
用的是PyCharm中文版,根据教程已安装pip install xlrd和xlwt,写了一行代码,打开Excel,结果报错求指点一下。谢谢。
import xlrd
xlsx=xlrd.open_workbook('d:\7d.xlsx')
table=xlsx.sheet_by_index(0)
print(table.cell_value(0, 0))
报错如下:
E:\code\php\untitled2\venv\Scripts\python.exe H:/python办公自动化/CourseCode/Chapter1/S1-1-1/LessonCode/1.1read.py
File "H:/python办公自动化/CourseCode/Chapter1/S1-1-1/LessonCode/1.1read.py", line 5
print(table.cell_value(0, 0))
^
SyntaxError: invalid character in identifier
进程已结束,退出代码 1
[size=15.0667px]E:\code\php\untitled2\venv\Scripts\python.exe H:/python办公自动化/CourseCode/Chapter1/S1-1-1/LessonCode/1.1read.py File "H:/python办公自动化/CourseCode/Chapter1/S1-1-1/LessonCode/1.1read.py", line 5 print(table.cell_value(0, 0)) ^SyntaxError: invalid character in identifier进程已结束,退出代码 1
|
|