def split_br(x, y, unit, name, location): sp(location + "a.pdf", [slice(x, y, None)]) os.rename(location + "a-split.pdf", location + name + "-" + unit + ".pdf")