例子文件如下: 一些复杂的读取操作getCells.py import openpyxl wb = openpyxl.load_workbook('example.xlsx') sheet = wb.get_sheet_by_name('Sheet1') print(sheet.cell(row=1, column=2).value) # from 1 to 8 step is 2 for i in range(1, sheet.max_row + 1, 2): print(i, sheet.c…
Python编程从入门到实践笔记——操作列表 #coding=utf-8 magicians = ['alice','david','carolina'] #遍历整个列表 for magician in magicians : print(magician) print("hello everyone!") #for循环(冒号和缩进) for number in range(1,6): print(number) #用range()创建数字列表 #list().range()前闭后开…