你好,我是Web开发的新手,一直在使用python来制作我的Web应用程序。这是我的代码:
def forecastvalues():
import fileinput
import csv
from pyexcel_xlsx import get_data
xlsxfile= "test.xlsx"
import json
with open(xlsxfile, "rb") as f:
content = f.read()
r = pe.get_book(file_type="xlsx", file_content=content, start_row=1)
for i in records:
columns = sheet.row[i]
for j in columns:
rem = sheet.column[0]
sold1 = sheet.column[1]
sold2 = sheet.column[2]
return '<h1>Result: %s</h1>' % result
我正确安装了 pyexcel,但是当我导入 pyexcel 时,它出现语法错误,我该如何解决这个问题?
content = f.read(( 不缩进,也不缩进其后行。
应该是:
with open(xlsxfile, "rb") as f:
content = f.read()
r = pe.get_book(file_type="xlsx", file_content=content, start_row=1)