【发布时间】:2020-04-05 19:14:38
【问题描述】:
我正在尝试允许用户上传 MS Word 文件,然后我运行某个将字符串作为输入参数的函数。我正在通过 FileUpload 上传 Word 文件,但是我得到了一个编码对象。我无法使用字节 UTF-8 进行解码,而使用 upload.value 或 upload.data 只会返回编码文本
知道如何从上传的 Word 文件中提取内容吗?
> upload = widgets.FileUpload()
> upload
#I select the file I want to upload
> upload.value #Returns coded text
> upload.data #Returns coded text
> #Previously upload['content'] worked, but I read this no longer works in IPYWidgets 8.0
【问题讨论】: