I have the following code:
but for some reason it just won't work if I touch the i
the query self works, cause if I just do .Append(str(i)) without the split strip it returns all the tables..

def mysql_table(self):
   self.list_box_3.Set([])
   try:
      self.cursor.execute("SHOW TABLES;")
      self.query = self.cursor.fetchall()
   except:
      self.log("error")
   for i in self.query:
      i = str(i).split().strip("'")[1]
      self.list_box_3.Append(str(i))

Recommended Answers

All 2 Replies

str(i).split() will give you a list and you cannot use strip("'") on a list object. If your list contains strings, pick one item and then strip it.

Ah, stupid, I did: str(i).split().strip("'") instead of str(i).strip().split("'") :f

thanks for the help anyway

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.