简体   繁体   中英

How can I remove characters from this created tuple? (Python and appJar)

I created a tuple from an SQL statement and am trying to print it now in a text box but get some of the items having these {} symbols. EDIT: Items that have multiple words like {The Matrix} get the characters whilst singular items like Inception have no extra characters.

This is an example of the results of an SQL statement:

[('The Matrix',), ('Inception',), ('Happy Gilmore',), ('Big Daddy',), ('Love Actually',), ('Airplane!',), ('Hot Fuzz',), ('Wonder',), ('Pulp Fiction',)]

resultmovies = c.fetchall()

print(resultmovies)


counter = 0
for item in resultmovies:
    program.infoBox("Your Movie list", (resultmovies[counter]), parent = None) 
    counter += 1

The result you are getting is in Python and so to use the rows you have to iterate over the tuples . for example : for list in dictionary: for tuple in list: tuple +=',' + tuple

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM