You can use Python’s *args syntax for this:
>>> a = range(20)
>>> b = (5, 12)
>>> a[slice(*b)]
[5, 6, 7, 8, 9, 10, 11]
Basically, you’re telling Python to unpack the tuple b into individual elements and pass each of those elements to the slice() function as individual arguments.