How would you create a comma-delimited string from a pyodbc result row?
<p>I have a resultset of rows stored in cursor.rows which are returned from a pyodbc.cursor.execute command. What is the fastest way to unpack this data and place it into a list of comma-seperated strings (or unpack into a custom object)?</p>

<p>Currently I am doing the following:</p>

<pre><code>cursor.execute(query_str)
f = open(out_file, 'w')
for row in cursor:
    f.write(','.join([str(s) for s in row]))
    f.write('\n')
</code></pre>

<p>This takes 130ms per row, which seems like a ridiculously expensive operation. How can I speed this up?</p>
