title: Extract string from a Tuple in python with psycopg2
body: <p>I have written a web.py service in python to access PostGres and get the table names inside the specific database.</p>
  
  <p><strong>CODE:</strong></p>
  
  <pre><code> def GET(self,r):
            web.header('Access-Control-Allow-Origin',      '*')
            web.header('Access-Control-Allow-Credentials', 'true')
            tables = []
            datasetID = web.input().dataSetID
            cursor = conn.cursor()
            cursor.execute("select relname from pg_class where relkind='r' and relname !~ '^(pg_|sql_)';")
            tablesWithDetails =    cursor.fetchall()
            print tablesWithDetails
            for x in tablesWithDetails:
              x.replace("(", "")
              x.replace(")","")
              tables.append(x)
              print tables;
  </code></pre>
  
  <p>This prints the table as follows,</p>
  
  <pre><code>[('acam_datasegregationdetails',), ('acam_datasegregationheader',), ('idn_accessinformation',), ('idn_b2cuseraccountmapping',), ('idn_b2cuserdevicemapping',), ('idn_b2cusers',), ('idn_roles',), ('idn_useraccountmapping')]
  </code></pre>
  
  <p><strong>Needed Output:</strong></p>
  
  <pre><code>['acam_datasegregationdetails', 'acam_datasegregationheader', idn_accessinformation', 'idn_b2cuseraccountmapping', 'idn_b2cuserdevicemapping', 'idn_b2cusers', 'idn_roles', 'idn_useraccountmapping']
  </code></pre>