Why does trying to print directly to a file instead of sys.stdout produce the following syntax error:
sys.stdout
Python 2.7.2+ (default, Oct 4 2011, 20:06
print(args, file=f1) is the python 3.x syntax. For python 2.x use print >> f1, args.
print(args, file=f1)
print >> f1, args