0

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))

Edited by Kruptein: n/a

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Kruptein
0

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.

0

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

thanks for the help anyway

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.