def two_mains(monitor): x1, y1, x2, y2 = monitor wa = get_dimensions(monitor) split = 0 grid = [] second_half = x1 + (wa.width / 2) + split grid.append([x1, y1, second_half, y2]) grid.append([second_half, y1, x2, y2]) return grid
def two_mains_vertical(monitor): x1, y1, x2, y2 = monitor wa = get_dimensions(monitor) split = 0 grid = [] second_half = y1 + (wa.height / 2) + split grid.append([x1, y1, x2, second_half]) grid.append([x1, second_half, x2, y2]) grid.append([x1, y1, x2, y2]) return grid
def one_main_two_side(monitor, split=300): x1, y1, x2, y2 = monitor wa = get_dimensions(monitor) grid = [] second_half = x1 + (wa.width / 2) + split grid.append([x1, y1, second_half, y2]) screen_y_split = (y2 - y1) / 2 grid.append([second_half, y1, x2, screen_y_split]) grid.append([second_half, screen_y_split, x2, y2]) return grid
def two_mains_two_sides(monitor): x1, y1, x2, y2 = monitor wa = get_dimensions(monitor) grid = [] thirds = wa.width / 3 grid.append([x1, y1, x1 + thirds, y2]) screen_y_split = (y2 - y1) / 2 grid.append([x1 + thirds, y1, x1 + (thirds * 2), screen_y_split]) grid.append([x1 + thirds, screen_y_split, x1 + (thirds * 2), y2]) grid.append([x1 + (thirds * 2), y1, x2, y2]) return grid
def spiral(monitor, squares=5): x1, y1, x2, y2 = monitor wa = get_dimensions(monitor) _cls = list(range(1, squares + 1)) n = len(_cls) old_width, old_height = wa.width, 2 * wa.height to_send = [] for k in _cls: if k % 2 == 0: wa.width, old_width = math.ceil(old_width / 2), wa.width if k is not n: wa.height, old_height = math.floor(wa.height / 2), wa.height else: wa.height, old_height = math.ceil(old_height / 2), wa.height if k is not n: wa.width, old_width = math.floor(wa.width / 2), wa.width if k % 4 is 0: wa.x -= wa.width elif k % 2 is 0: wa.x += old_width elif k % 4 is 3 and k < n: wa.x += math.ceil(old_width / 2) if k % 4 is 1 and k is not 1: wa.y -= wa.height elif k % 2 is 1 and k is not 1: wa.y += old_height elif k % 4 is 0 and k < n: wa.y += math.ceil(old_height / 2) g = { "x": int(wa.x), "y": int(wa.y), "width": int(wa.width), "height": int(wa.height) } to_send.append( [g["x"], g["y"], g["x"] + g["width"], g["y"] + g["height"]]) return to_send
filename='app.log', filemode='w', format='%(name)s - %(levelname)s - %(message)s') # load the excel docs gsq = f.load_workbook('gsq.xlsx') merlin = f.load_workbook('merlin.xlsx') # grab the current worksheets ws = gsq.active merlin_ws = merlin.active # manually create Merlin data's dimensions merlin_dimensions = f.Dimension('A', '1', 'G', '184899') dimensions = f.get_dimensions(ws) # dimensions of the gsq excel doc # get the FIELD_ID cells from the merlin excel # FIELD_IDs = [f for f in merlin_ws['G'] if f.coordinate != 'G1'] FIELD_IDs = dict([(f.value, f) for f in merlin_ws['G'] if f.coordinate != 'G1']) row_count = 0 for row in ws.iter_rows(min_row=dimensions.min_row + 1, max_row=dimensions.max_row, max_col=12): row_count += 1 for i, cell in enumerate(row): if 'J' in cell.coordinate: # j column if isinstance(cell.value, int):