参考:https://www.jianshu.com/p/19219542bf23
python读取excel
单循环读取表数据
import xlrd
class DoExcel():
def do_excel(self):
data = xlrd.open_workbook(r'E:mycodetest_pythonexcel01.xlsx')
sheet1 = data.sheet_by_name('Sheet1')
list = []
for i in range(0, sheet1.nrows):
sub_data = {}
sub_data['一'] = sheet1.cell(i, 0).value # i行第一列
sub_data['二'] = sheet1.cell(i, 1).value # i行第二列
list.append(sub_data)
return list
if __name__ == '__main__':
DoExcel().do_excel()
最后
以上就是受伤橘子最近收集整理的关于python单循环读取表数据excelpython读取excel的全部内容,更多相关python单循环读取表数据excelpython读取excel内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复