x = 99y = "Hi"import syssys.stdout = open('log.txt', 'a') # redirects prints to fileprint x, y, x # shows up in log.txt