Added an argument to output to any filelike object.

This feature was suggested by Reddit user badboybeyer.