A
Anjanesh Lekshminarayanan
Using Python 3.0
res = urllib.request.urlopen(url)
f = open('file.txt', 'wb') # Since res.read() returns bytes
f.write(res.read())
But newline and return feeds are stored as b14, 58a as text in the text file.
So how do I to convert res.read() to ascii on opening the file in
ascii mode f = open('file.txt', 'w')?
Thanks
res = urllib.request.urlopen(url)
f = open('file.txt', 'wb') # Since res.read() returns bytes
f.write(res.read())
But newline and return feeds are stored as b14, 58a as text in the text file.
So how do I to convert res.read() to ascii on opening the file in
ascii mode f = open('file.txt', 'w')?
Thanks