enkryptor

Untitled

Feb 5th, 2022
893
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. from openpyxl.reader.excel import load_workbook
  2.  
  3.  
  4. wb2 = load_workbook(filename = 'sebes.xlsx')
  5. wb3 = load_workbook(filename = 'ishod.xlsx')
  6. ws2 = wb2.active
  7. ws3 = wb3.active
  8.  
  9. def find_sebes(arg):
  10.     slovar = dict(arg)
  11.     for row in ws3.values:
  12.         shtrih = row[0]
  13.         sebes = slovar.get(shtrih)
  14.         if (sebes):
  15.             print(shtrih, sebes)
  16.  
  17.  
  18. def create_list():
  19.     data = []
  20.     for row in ws2.values:
  21.         shtrih = row[0]
  22.         sebes = row[6]
  23.         data.append((shtrih, sebes))
  24.     return data
  25.  
  26.  
  27. def show_list(arg):
  28.     print(dict(arg).get('4605319001296'))
  29.  
  30.  
  31. find_sebes(create_list())
  32. wb2.close()
  33. wb3.close()
Advertisement
Add Comment
Please, Sign In to add comment