title: Using flask, how can I return a row of data as a list
body: <p>I am trying to get my route to return a row in a list format but it appears to be returning a concatenation of the row items. How can I return the row of data in list format? Or how can I get a specific row object from the table shown on the page in a general sense to provide that data to a microservice?</p>
  <p>Here is what I want it to return:
  ['field1', 'field2', 'field3', 'field4', 'field5']</p>
  <p>What it appears to return is:
  ['field1' 'field2' 'field3' 'field4' 'field5']</p>
  <p>Here is my app.py file:</p>
  <pre><code>from flask import Flask, render_template, json, redirect, request
  import pandas as pd 
   
  # Flask constructor
  app = Flask(__name__)
   
  # Data setup
  table = pd.read_csv(&quot;table.csv&quot;)
  table.fillna('', inplace=True)
  headings = list(table.columns)
  print(headings)
  data = list(table.values)
  print(data)
  
  # Homepage URL call
  @app.route(&quot;/&quot;)
  def home():
      return render_template(&quot;home.html&quot;, headings=headings, data=data)
  
  @app.route('/GetInfo/&lt;row&gt;')
  def GetInfo(row):
      return row
  
  # Listener
  if __name__ == &quot;__main__&quot;:
      app.run(port=2509, debug=True)
  </code></pre>
  <p>Here is my home.html file:</p>
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div&gt;
      &lt;table&gt;
        &lt;tr&gt;
          {% for header in headings %}
          &lt;th class=&quot;cell&quot;&gt;{{header}}&lt;/th&gt;
          {% endfor %}
          &lt;th&gt;Info&lt;/th&gt;
        &lt;/tr&gt;
        {% for row in data %}
        &lt;tr class=&quot;row&quot;&gt;
          {% for cell in row %}
          &lt;td&gt;{{cell}}&lt;/td&gt;
          {% endfor %}  
          &lt;td&gt;&lt;a href=&quot;GetInfo/{{row}}&quot;&gt;Info&lt;/a&gt;&lt;/td&gt;
        &lt;/tr&gt;
        {% endfor %}
      &lt;/table&gt;
    &lt;/div&gt;  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>