For example, within the same script, I would have a simulate_magic_numbers function with a loop that produces a sequence of magic numbers continuously for a few hours and returns them once done. Below, I would like to have a while loop that grabs the magic numbers every 10 minutes and plots them.
I know how to do it with two separate scripts and saving intermediate numbers to a file, but it would be great to be able to do it within a single Jupiter notebook. However, there doesn't seem to be a straight-forward way of doing it.