How to redirect 'print' output to a file using python?,f.write('whatever')