I have a python file like this
import urllib2
try:
data = urllib2.urlopen('http:....').read()
except urllib2.HTTPError, e:
print "HTTP error: %d" % e.code
except urllib2.URLError, e:
print "Network error: %s" % e.reason.args[1]
print data1
The output is as follows:
>>>
15.95
>>>
I need to perform some manipulations with data1 (or any alternative variable) so that when printing data1 (or a new variable) there is no extra line in the output. In other words, I want it to look like this:
>>>
15.95
>>>
Any help would be great. I am relatively new to python. I spun with \ r and can't make it work.
source
share