提交 d2d9e999 编写于 作者: weixin_47589350's avatar weixin_47589350

生产代码片段

上级 2eebcf6c
print('欢迎来到 InsCode')
\ No newline at end of file
import openpyxl
# 打开Excel文件
workbook = openpyxl.load_workbook('example.xlsx')
# 选择要操作的工作表
sheet = workbook['Sheet1']
# 获取单元格内容
cell_value = sheet['A1'].value
# 拆分单元格内容
parts = cell_value.split(',')
# 打印拆分后的结果
for part in parts:
print(part)
# 关闭Excel文件
workbook.close()
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册