Using 2.7:
from functools import partial
from random import randint
for roll in iter(partial(randint, 1, 8), 1):
print 'you rolled: {}'.format(roll)
print 'oops you rolled a 1!'
you rolled: 7
you rolled: 7
you rolled: 8
you rolled: 6
you rolled: 8
you rolled: 5
oops you rolled a 1!
Then change the "oops" print to a raise SystemExit