Set format to cursor.fetchall() result
<p>Im working with mysql.connection library to Python and I have this method: </p>

<pre><code>query = ("select " + columns + " from " + table)
self.cursor.execute(query)
data = self.cursor.fetchall()
for row in data:
    print row
</code></pre>

<p>In my print row, I get something like this:</p>

<pre><code>(u'Kabul', u'AFG', u'Kabol', 1780000)
</code></pre>

<p>I would like to get it as a string, this result:</p>

<pre><code>Kabul AFG Kabol 1780000
</code></pre>

<p>I can do this:</p>

<pre><code>print row[0] + ' ' + row[1] + row[2] + ' ' + row[3]
</code></pre>

<p>But it will not work if the user sets a query with less than 4 columns or more than 4. </p>

<p>I also was thinking about a loop in my tuple, but I get this result:</p>

<pre><code>Kabul
AFG
Kabol
1780000
</code></pre>

<p>Some idea?</p>