Re: python 2 urlopen vs python 3 urlopen

2018-08-27 Thread Terry Reedy
On 8/27/2018 1:25 PM, Sean Darcy wrote: python 2 : python Python 2.7.15 (default, May 15 2018, 15:37:31) . import urllib2 res = urllib2.urlopen('https://api.ipify.org').read() print res www.xxx.yyy.zzz In Python 2, this is the printed representation of a bytestring. python3 python3 Py

Re: python 2 urlopen vs python 3 urlopen

2018-08-27 Thread Chris Angelico
On Tue, Aug 28, 2018 at 3:25 AM, Sean Darcy wrote: > python 2 : > > python > Python 2.7.15 (default, May 15 2018, 15:37:31) > . import urllib2 res = urllib2.urlopen('https://api.ipify.org').read() print res > www.xxx.yyy.zzz > > python3 > > python3 > Python 3.6.6 (default, Jul 1

python 2 urlopen vs python 3 urlopen

2018-08-27 Thread Sean Darcy
python 2 : python Python 2.7.15 (default, May 15 2018, 15:37:31) . >>> import urllib2 >>> res = urllib2.urlopen('https://api.ipify.org').read() >>> print res www.xxx.yyy.zzz python3 python3 Python 3.6.6 (default, Jul 19 2018, 16:29:00) ... >>> from urllib.request import urlopen >>> res = url