Python 如何在google colab中读取.docx文件?
我正试图将docx文件读入google collab,因为我和anaconda在一起的主计算机已经进行了维护。我试图使用PythonDocx模块,但据我所知,我不能在GoogleCollab中安装PythonDocx ''' '''Python 如何在google colab中读取.docx文件?,python,python-3.x,google-colaboratory,google-docs,file-read,Python,Python 3.x,Google Colaboratory,Google Docs,File Read,我正试图将docx文件读入google collab,因为我和anaconda在一起的主计算机已经进行了维护。我试图使用PythonDocx模块,但据我所知,我不能在GoogleCollab中安装PythonDocx ''' ''' 有什么想法吗?试试下面的方法;希望它能起作用: #Install python-docx !pip install python-docx #<-- Yes you can directly install in Colab #Import the tool
有什么想法吗?试试下面的方法;希望它能起作用:
#Install python-docx
!pip install python-docx #<-- Yes you can directly install in Colab
#Import the tools
import docx
from google.colab import files
uploaded = files.upload() #<-- Select the file you want to upload
file_name = '[whatever your file is called here].docx' #<-- Change filename to your file
doc = docx.Document(file_name)
#安装python docx
!pip安装pythondocx#
#Install python-docx
!pip install python-docx #<-- Yes you can directly install in Colab
#Import the tools
import docx
from google.colab import files
uploaded = files.upload() #<-- Select the file you want to upload
file_name = '[whatever your file is called here].docx' #<-- Change filename to your file
doc = docx.Document(file_name)