Py3 - converting bytes to ascii

Casey Caseyweb at
Thu Jan 15 16:53:25 CET 2009

On Jan 15, 9:54 am, "Anjanesh Lekshminarayanan" <m... at>
> Using Python 3.0
> So how do I to convert to ascii on opening the file in
> ascii mode f = open('file.txt', 'w')?

I think this is what you are looking for:

res = urllib.request.urlopen(url)
f = open('file.txt', 'w')

More information about the Python-list mailing list