Replacing the print function in python to limit the amount written to screen.