Re: Python 2 -> 3, urllib.urlopen (corrected the case)

2017-10-15 Thread Ben Bacarisse
Irv Kalb writes: >> On Oct 14, 2017, at 6:46 PM, Ben Bacarisse wrote: Finally, wget -S shows that the resource has moved. It is now at Location: http://download.finance.yahoo.com/d/quotes.csv?s=aapl&f=l1 I don't think this has anything to do with your problem, but it'

Re: Python 2 -> 3, urllib.urlopen (corrected the case)

2017-10-15 Thread Irv Kalb
> On Oct 14, 2017, at 6:46 PM, Ben Bacarisse wrote: > > Irv Kalb writes: > >> Thank you! > > You're welcome. > > >>> Just a data point... It works here: >>> >>> $ python3 t.py >>> Response is: b'156.99\n' >>> $ cat t.py >>> import urllib.request >>> fullURLWithParameters = 'http://financ

Re: Python 2 -> 3, urllib.urlopen (corrected the case)

2017-10-14 Thread Ben Bacarisse
Irv Kalb writes: > Thank you! You're welcome. >> Just a data point... It works here: >> >> $ python3 t.py >> Response is: b'156.99\n' >> $ cat t.py >> import urllib.request >> fullURLWithParameters = 'http://finance.yahoo.com/d/quotes.csv?s=aapl&f=l1' >> # read all the data >> response = ur

Re: Python 2 -> 3, urllib.urlopen (corrected the case)

2017-10-14 Thread Irv Kalb
Thank you! > On Oct 14, 2017, at 12:10 PM, Ben Bacarisse wrote: > > Irv Kalb writes: > > Lots of detail snipped. I hope it won't matter... > >> > (_ssl.c:749)> >> >> Huh??? >> >> I've read a bunch of documentation, and it looks like I'm doing >> everything right, but I cannot get this to w

Re: Python 2 -> 3, urllib.urlOpen

2017-10-14 Thread Mark Lawrence via Python-list
On 13/10/17 23:27, Irv Kalb wrote: One of the colleges where I teach has just moved from Python 2 to Python 3. I am in the process of converting my beginning Python class from Python 2 to Python 3. Everything has gone smoothly, until I just tried to convert some code that imports and uses ur

Re: Python 2 -> 3, urllib.urlopen (corrected the case)

2017-10-14 Thread Ben Bacarisse
Irv Kalb writes: Lots of detail snipped. I hope it won't matter... > (_ssl.c:749)> > > Huh??? > > I've read a bunch of documentation, and it looks like I'm doing > everything right, but I cannot get this to work. Any other > suggestions to get this 3 line program to work correctly? Just a da

Re: Python 2 -> 3, urllib.urlopen (corrected the case)

2017-10-14 Thread MRAB
On 2017-10-14 18:40, Irv Kalb wrote: On Oct 13, 2017, at 3:27 PM, Irv Kalb wrot If I take the same program and just modify the print statement to add parentheses, then try to run it in Python 3.6 (on a Mac): ... import urllib # set the Yahoo finance url, set stock name, ask for last price f

Re: Python 2 -> 3, urllib.urlopen (corrected the case)

2017-10-14 Thread Irv Kalb
> On Oct 13, 2017, at 3:27 PM, Irv Kalb wrot > If I take the same program and just modify the print statement to add > parentheses, then try to run it in Python 3.6 (on a Mac): > > ... > import urllib > > # set the Yahoo finance url, set stock name, ask for last price > fullURLWithParameters =

Re: Python 2 -> 3, urllib.urlOpen

2017-10-13 Thread MRAB
On 2017-10-13 23:27, Irv Kalb wrote: One of the colleges where I teach has just moved from Python 2 to Python 3. I am in the process of converting my beginning Python class from Python 2 to Python 3. Everything has gone smoothly, until I just tried to convert some code that imports and uses

Re: Python 2 -> 3, urllib.urlOpen

2017-10-13 Thread Thomas Jollans
On 14/10/17 00:27, Irv Kalb wrote: > One of the colleges where I teach has just moved from Python 2 to Python 3. > I am in the process of converting my beginning Python class from Python 2 to > Python 3. Everything has gone smoothly, until I just tried to convert some > code that imports and u

Re: Python 2 -> 3, urllib.urlOpen

2017-10-13 Thread boB Stepp
On Fri, Oct 13, 2017 at 5:27 PM, Irv Kalb wrote: > I've looked at the Python 3.6 documentation for urllib, and I see that > certain calls have been changed and others have been eliminated. But my eyes > glaze over trying to figure out what to use instead. > > My question is: Is there a simple

Python 2 -> 3, urllib.urlOpen

2017-10-13 Thread Irv Kalb
One of the colleges where I teach has just moved from Python 2 to Python 3. I am in the process of converting my beginning Python class from Python 2 to Python 3. Everything has gone smoothly, until I just tried to convert some code that imports and uses urllib.urlOpen to fetch data through an