import syssOUT = sys.stdoutsERR = sys.stderrsys.stdout = open("ouput.txt", "w")sys.stderr = sys.stdoutsys.stdout = sOUTsys.stderr = sERR