一、读取excel文件
1、安装robotframework-ExcelLibrary文件
由于该库只支持到python2.7,因此不能使用python3的pip安装此文件,需要先下载该库:robotframework-excellibrarypypi.org
解压后修改几个文件,因为,在3.x中execfile被废弃了,需要使用exec函数来代替。 同时,3.x print是个函数,必须加小括号进行函数调用, 需要进行的修改包括:
#execfile(join(dirname(file), ‘ExcelLibrary’, ‘version.py’))
exec(open(join(dirname(file), ‘ExcelLibrary’, ‘version.py’)).read())
将所有的print xxx 语句修改为 print(xxx)
#from version import VERSION
from .version import VERSION
3) init.py
#from ExcelLibrary import ExcelLibrary
#from version import VERSION
from .ExcelLibrary import ExcelLibrary
from .version import VERSION
最后使用python setup.py install,