problem with string

John Machin sjmachin at lexicon.net
Thu Jul 21 19:56:09 EDT 2005


Tzanko Tzanev wrote:
> hi :)
> I need some help for this script
> I have
> --------------------
> cursor = conn.cursor()
> cursor.execute("select * from playlist limit 5")
> result = cursor.fetchall()
> # iterate through resultset
> playlist_txt = ''
> for record in result:
> mp3id = record[0]
> mp3_title = record[1]
> mp3_artist = record[2]
> playlist_txt += mp3id + mp3_title + mp3_artist
> #print mp3id , " - ", mp3_title , ' - ', mp3_artist , "<br />"
> cursor.close()
> conn.close()
> ------------------
> #and want to print this out of "for record in result:"
> print playlist_txt
> 
> #but there is an error in
> playlist_txt += mp3id + mp3_title + mp3_artist

Have you considered doing "print record" at the appropriate place?

Care to tell us what the error message is, or is it a state secret that 
can be obtained only by hanging you by your extremities and inserting 
laxatives into your ears with firehoses?




More information about the Python-list mailing list