Can this be done in Python?.. which is done in perl.
open(TEST,">test.txt"); *STDOUT = *TEST; print "print somting..."; print "print somting..."; *STDOUT = *FHSAVE;
All the print statement between the lines "*STDOUT = *FHSAVE;" will be written in to test.txt. Is there any way to do this in python.