array = list(range(10))
array
i, size = 1, 10
array[i:i + size] + array[:max(0, i + size - len(array))]
i, size = 2, 3
array[i:i + size] + array[:max(0, i + size - len(array))]
i, size = 5, 9
array[i:i + size] + array[:max(0, i + size - len(array))]
Python how cyclic fetch a pre-fixed number of elements in array