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 (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 =