第1个回答 2020-06-16
pip install pyexcel
读取文件以后,在重新写入文件就可以了。
import pyexcel as pe
import pyexcel.ext.xls # import it to handle xls file
import pyexcel.ext.xlsx # import it to handle xlsx file
records = pe.get_records(file_name="your_file.xls")
for record in records:
print("%s is aged at %d" % (record['Name'], record['Age']))