Basically convert the ScreenGen function to a generator, instead of printing the output in the for loop, yielding it turning the function into a generator
This would allow the user to stop iteration from outside the script as well as yield the output via a variable instead of the print statement, by iterating via a for or while loop. This would make it possible to easily update a progress bar or anything else in a graphical user interface