Jul-02-2021, 11:49 PM
I've got 2.7 and 3.3 versions. The 3.3 is in spyder on windows. The 2.7 is python in linux.
I'm reading data from a socket, and If I do this,
It outputs correctly, with the newlines in the data causing output on separate lines, as desired.
But this won't work in 3.3 and so, I've done this,
and then it spits out all the text and replaces the newlines with \n instead and doesn't actually do the newlines.
How can I do this compatibly between the 2 versions?
I'm reading data from a socket, and If I do this,
print "received data:", data
It outputs correctly, with the newlines in the data causing output on separate lines, as desired.
But this won't work in 3.3 and so, I've done this,
print("received data:",data)
and then it spits out all the text and replaces the newlines with \n instead and doesn't actually do the newlines.
How can I do this compatibly between the 2 versions?