I want to create a log of all the print functions and save it in a file which I can display on Flask HTML page. The script is very complex but some what like below:
def main():
def one function():
# do something
print(response)
def other function():
print(response2)
......
if __name__ == '__main__':
import sys
sys.exit(main())