hay all, I just did the following:
a = input("give a word: ")
b = input("give another word: ")
c = a + " " + b
print("result is", c)
and get the output as follows:
give a word: name
give another word: word
result is name
word
my question is why the output on pydev or eclipse console in two lines? i expected to output as follows:
give a word: name
give another word: word
result is name word
how and why this happens to me? on cmd its looking fine??!!
also i found that python saves the strings with “\r”, i think that is the one making this problem on pydev console, is it?
It seems to me that Eclipse + PyDev is storing the newline character in the string as well. There are a few variants of the newline character depending on the operating system: \n, \r, \r\n.
In any case, I think the following should fix your problem:
I have tested this code on PyDev for Eclipse Galileo on Windows7 and it works.
Hope this helps