I am using python sys to save my stdout to a text file.
sys.stdout=open('OLSYield.txt','w')
However I only want a portion of the stdout to go to the text. How do I stop writing to txt file and redirect back to the terminal or console?
So it should look something like
sys.stdout=open('OLSYield.txt','w')
print "helloWorld appears in text file"
sys.stdout=close('OLSYield.txt','w')
print "helloWorld appears in console"
Im not sure what command I should use to close stdout=open