import os
from openpyxl import load_workbook
excel_stus = request.FILES.get("excel_stus") # 获取文件
path = os.path.join("media","files",excel_stus.name) # 存放操作后的文件
with open(path,"wb") as f:
for line in excel_stus:
f.write(line)
wb = load_workbook(path)
# print("wb.sheetnames",wb.sheetnames)
worksheet = wb.worksheets[0]
for line in work_sheet.iter_rows(min_row=3):
# print("line",line)
# for cell in line:
# print(cell.value)
print(line[索引值].value) # 索引值从 0 开始
通过WPF的按钮、文本输入框实现了一个简单的SpinBox数字输入用户组件并可以通过数据绑定数值和步长。本文中介绍了通过Xaml代码实现自定义组件的布局,依赖属性的定义和使用等知识点。