Am i able to overload the print function? and call the normal function? What i want to do is after a specific line i want print to call my print which will call the normal print and write a copy to file.
Also i dont know how to overload print. I dont know how to do variable length arguments. i'll look it up soon but http://stackoverflow.com/questions/550470/overload-print-python/550477#550477 just told me i cant overload print in 2.x which is what i am using.
However, you can override sys.stdout. (example.) Just assign it to another file-like object that does what you want.
Alternatively, you could just pipe your script through the the unix
python yourscript.py | tee output.txt will print to both stdout and to output.txt, but this will capture all output.