from sqlalchemy import create_engine
b_connection_string = 'mysql://user:password@localhost/db_name'
user = "admin"
db = create_engine(db_connection_string)
for row in db.execute("select Permissions from users where Name = "%s""%(user)):
result.append(str(row))
[“(‘On, Off, Bla-bla’,)”]
Теперь можно облагородить результат, добавив , например:
result = result[0].replace("('","")
result = result.replace("',)","")
result = result.replace(", ", ",")
Получим в result: ‘On, Off, Bla-bla’