Update Task02 Python与Excel.md

This commit is contained in:
Muxiaoxiong
2021-06-16 18:12:25 +08:00
committed by GitHub
parent cc1d2a49f2
commit b819f5dcf0

View File

@@ -135,9 +135,9 @@ from openpyxl import load_workbook
exl = load_workbook(filename = 'test.xlsx')
sheet = exl.active
sheet['A1'] = 'hello word'
sheet['A1'] = 'hello world'
#或者cell = sheet['A1']
#cell.value = 'hello word'
#cell.value = 'hello world'
exl.save(filename = 'test.xlsx') #存入原Excel表中若创建新文件则可命名为不同名称
```