Installed and tested XLRD:
>>> import xlrd
>>> workbook = xlrd.open_workbook('Sample.xls')
When I read the file through the html form as shown below, I can access all the values.
xls_file = request.params['xls_file']
print xls_file.filename, xls_file.type
I use the Pylons module, the request comes from: from pylons import request, tmpl_context as c
My questions:
- Is the object
xls_fileread requst.params? - How can I read
xls_fileand make it work with xlrd?
Update:
xls_fileis uploaded to the web server, but the xlrd library expects a file name instead of an open file object. How to make the downloaded file work with xlrd? (Thanks to Martijn Pieters, I could not clearly state the question.)
source
share