title: making a programme run indefinitely in python
body: <p>Is there any way to make a function (the ones I'm thinking of are in the style of the simple ones I've made which generate the fibonnacci sequence from 0 to a point, and all the primes between two points) run indefinitely.   E.g. until I press a certain key or until a time has passed, rather than until a number reaches a certain point? </p>
  
  <p>Also, if it is based on time then is there any way I could just extend the time and start it going from that point again, rather than having to start again from 0? I am aware there is a time module, i just don't know much about it.</p>