•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 429,859 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,485 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser: Programming Forums
Views: 1587 | Replies: 4
hi 
I need some help for this script
I have
--------------------
------------------
#and want to print this out of "for record in result:"
#but there is an error in
10x in advance
))

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
10x in advance
)) •
•
•
•
•
•
•
•
DaniWeb Python Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Problem formating VB string for clipboard (Visual Basic 4 / 5 / 6)
- Addnew problem (Visual Basic 4 / 5 / 6)
- ANSI string problem (C++)
- Problem While Processing A String List (C++)
- Help with problem (Java)
Other Threads in the Python Forum
- Previous Thread: copy a file
- Next Thread: Opening HTTP sessions with Python



Threaded Mode