473,503 Members | 13,285 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

jython code

4 New Member
Hi,

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
  4.  
('http://10.136.229.129:7010',)
('http://10.136.229.129:7020',)
('http://10.136.229.129:7030',)
('http://10.136.229.129:7040',)
('http://10.136.229.44:7050',)
('http://10.136.229.44:7060',)
('http://10.136.229.44:7070',)
('http://10.136.229.44:7080',)


but I want to get below output

http://10.136.229.129:7010
http://10.136.229.129:7020
http://10.136.229.129:7030
http://10.136.229.129:7040
http://10.136.229.44:7050
http://10.136.229.44:7060
http://10.136.229.44:7070
http://10.136.229.44:7080

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

Regards
spgreddy
Dec 15 '14 #1
1 1430
bvdet
2,851 Recognized Expert Moderator Specialist
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

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

Similar topics

0
1432
by: Matt Newcomb | last post by:
G'day, Hi. I'm new to jython/python and am trying to interface a jython script with some java code that produces property change events. Here's the jython code: import sys; from javax...
4
4487
by: Michael Chermside | last post by:
Ype writes: > For the namespaces in Jython this 'Python internal thread safety' > is handled by the Java class: > > http://www.jython.org/docs/javadoc/org/python/core/PyStringMap.html > > which...
6
2099
by: Dave Benjamin | last post by:
Hey good people, I've been doing a lot of simultaneous Jython and CPython programming lately, and just wanted to say, with no intended ill will toward any of the individuals who have been...
1
2388
by: Mike Grigorov | last post by:
I am using cheetah with jython 2.1 and I have problem generating templates that contain cyrillic text. Some texts are printed OK and others are not. I searched Jython and cheetah projects mailing...
1
2210
by: Raja | last post by:
I have a java class thats trying to call something in python. This works fine when i do a jythonc on the python script. When i call another python script from the __init__ of my called python...
4
3409
by: angel | last post by:
A java runtime environment includes jvm and java class (for example classes.zip in sun jre). Of course jython need jvm,but does it need java class. Thanx
7
12730
by: Jan Gregor | last post by:
Hello I found that jython catches exact java exceptions, not their subclasses. Is there some way to get around this limitation (or error) ? My program has class representing database source...
12
5891
by: Mark Fink | last post by:
I wrote a Jython class that inherits from a Java class and (thats the plan) overrides one method. Everything should stay the same. If I run this nothing happens whereas if I run the Java class it...
3
2551
by: Sloan.Kohler | last post by:
Is Jython development dead or has it just seemed that way for over a year?. The jython.org website has a recent new appearance (but no new content) and there is some message traffic on the...
5
3594
by: sarup26 | last post by:
Hello .. I would like to know more about Python and Jython? What is the difference between both of them? What is the future for Jython and which are the areas where it is used? Swot
0
7212
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5604
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3186
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
405
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.