Advertisement
elena1234

openpyxl and print a column in Python

Mar 1st, 2023 (edited)
704
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | Source Code | 0 0
  1. import openpyxl as xl
  2. from tax_calculator import tax_calculator
  3.  
  4. wb = xl.load_workbook('maven_ski_shop_data.xlsx')
  5.  
  6. orders = wb['Orders_Info']
  7. orders
  8.  
  9. orders['A10'].value
  10.  
  11.  
  12. def print_column(sheet, letter):
  13.     for index, cell in enumerate(sheet[letter], start = 1):
  14.         print(f'{letter}{index} {cell.value}')
  15.  
  16. print_column(orders, 'A')
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement