title: UnicodeEncodeError while redirecting output to file - python 2.7
body: <p>I have to redirect the output of a googlemaps API function to a file. I have a few <code>objects</code> in my pandas dataframe and I am getting their addresses through the google API.</p>
  
  <pre><code>import googlemaps
  from __future__ import print_function
  f=open('output.csv', 'w')
  for idx, row in df.iterrows():
      gmaps = googlemaps.Client(key="my_key")
      reverse_result = gmaps.reverse_geocode((row['lat'], row['lon']), result_type='administrative_area_level_3')
      for result in reverse_result:
          print (row['object'],result["formatted_address"], file=f)
  </code></pre>
  
  <p>As I do so, I get the error:</p>
  
  <pre><code>UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 15: ordinal not in range(128)
  </code></pre>
  
  <p>If I simply print it to the screen it works flawlessly and it displays a well formatted address; the issue is in the process of writing it to an external file. I think I understand what the error message is telling me - there is some character in the output which is not encoded in utf8 - but I don't know how to work around it and have my output written to my csv.</p>