title: creating a csv file from a function result, python
body: <p>I am using this pdf to csv function from {<a href="https://stackoverflow.com/questions/25665/python-module-for-converting-pdf-to-text">Python module for converting PDF to text</a>} and I was wondering how can I now export the result to a csv file on my drive? I tried adding in the function </p>
  
  <pre><code>with open('C:\location', 'wb') as f:
      writer = csv.writer(f)
      for row in data:
          writer.writerow(row)
  </code></pre>
  
  <p>but the resulting csv file has one character per row and not the rows I have when printing data in python.</p>