Advertisement
Guest User

WorkSheet

a guest
Aug 21st, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. import openpyxl
  2.  
  3. wb = openpyxl.load_workbook('example.xlsx')  #getting name of specified file
  4. sheet = wb['Sheet1']
  5. print(sheet)
  6. print(sheet.title)
  7. print(sheet['A1'].value)
  8. print(sheet['b1'].value)
  9.  
  10. c = sheet['b1']
  11. print('Row' + str(c.row) + ', Column' + c.column + ' is ' + c.value)
  12.  
  13. print('Row' + str(c.row) + ', Column' + c.column + ' is ' + c.value)
  14. TypeError: can only concatenate str (not "int") to str
  15.             A               B           C
  16. 1   2015-04-05 13:34    jabłka         73
  17. 2   2015-04-05 13:34    wiśnie         85
  18. 3   2015-04-06 12:46    gruszki         14
  19. 4   2015-04-08 08:59    pomarańcze     52
  20. 5   2015-04-10 02:07    jabłka         152
  21. 6   2015-04-10 18:10    banany          23
  22. 7   2015-04-10 02:40    truskawki       98
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement