SHARE
TWEET

Untitled

a guest Jan 21st, 2020 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def unit_and_local_numbers():
  2.     unit_team_dict = {
  3.         'Eastern Unit':lambda input : eastern_unit.append(input),
  4.         'Eastern Local Team':lambda input : eastern_local_teams.append(input),
  5.         'Mid West Unit':lambda input : mid_west_unit.append(input),
  6.         'Mid West Local Team':lambda input : mid_west_local_teams.append(input),
  7.         'North East Unit':lambda input : north_east_unit.append(input),
  8.         'North East Local Team':lambda input : north_east_local_teams.append(input),
  9.         'North West Unit':lambda input : north_west_unit.append(input),
  10.         'North West Local Team':lambda input : north_west_local_teams.append(input),
  11.         'South East Unit':lambda input : south_east_unit.append(input),
  12.         'South East Local Team':lambda input : south_east_local_unit.append(input),
  13.         'South West Unit': lambda input: south_west_unit.append(input),
  14.         'South West Local Team': lambda input: south_west_local_teams.append(input),
  15.         'West Central Mid Unit':lambda input : west_central_midlands_unit.append(input),
  16.         'West Central Mid Local Team':lambda input : west_central_midlands_local_teams.append(input)
  17.     }
  18.     units_and_local_workbook = load_workbook(filename='teams.xlsx')
  19.     for sheets in units_and_local_workbook:
  20.         unit_sheet = units_and_local_workbook.get_sheet_by_name(sheets.title)
  21.         for value in unit_sheet.iter_rows(min_row=3, min_col=1, max_col=1, values_only=True):
  22.             string_out = str(value)
  23.             unit_number = re.findall(r'\d+', string_out)
  24.             unit_team_dict[unit_sheet.title](int(unit_number[0]))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top