By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,109 Members | 1,007 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,109 IT Pros & Developers. It's quick & easy.

jython code

P: 4

When I execute below program I am getting the below output.

Expand|Select|Wrap|Line Numbers
  1. for row in c.fetchall():
  2.         urls=row
  3.         print urls

but I want to get below output

Please let me know how can I achieve this by either python or jython script

Dec 15 '14 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 2.5K+
P: 2,851
c.fetchall() returns a list of tuples. To cover the possibility of an empty tuple or tuple with multiple entries:
Expand|Select|Wrap|Line Numbers
  1. print "\n".join([",".join(item) for item in c.fetchall()])
Dec 15 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.