参考网页: https://www.cnblogs.com/yhms/p/10138513.html https://www.jb51.net/article/117515.htm import os from openpyxl import load_workbook def print_hi(name): # Use a breakpoint in the code line below to debug your script. print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint. # Press the green button in the gutter to run the script. if __name__ == '__main__': print_hi('PyCharm') os.chdir("D:\Images\python_excel_test") workbook1 = load_workbook('test_case.xlsx') sheet = workbook1['test_data'] data = sheet.cell(3, 2).value print(data) for row in sheet.rows: for cell in row: print(cell.value) for column in sheet.columns: for cell in column: print(cell.value)