No Error; No Output...Nothing
mmr15 at case.edu
Tue Oct 21 23:58:18 CEST 2014
On 10/21/2014 05:44 PM, ryguy7272 wrote:
> Hey everyone, I'm trying to run this code.
> I commented out the import pylab as pl because I couldn't get the matplotlib.pylab import working. So, anyway, I hit F5, and it seems to run, but it doesn't really do anything. Isn't this either supposed to be downloading data from the web, or throwing an error so I can troubleshoot, and try to figure out what's going on? It's hard to troubleshoot, when you don't get any error. Does this work for others?
No, it isn't supposed to be downloading data from the web. You have
defined a few functions but you're not actually calling any of them. The
script terminates successfully with no output, since there's nothing for
it to do after executing your imports and function definitions.
Additionally, your attempted use of 'urllib2' inside
getConstituentsOfAnIndexFromYahoo will fail. Your import of that module
is commented out, since (from your imports) you're presumably using
Python 3 and a module with that name no longer exists. Since you have
'from urllib.request import urlopen', you can use the 'urlopen' module
without any fully-qualified name. The relevant line in your
getConstituentsOfAnIndexFromYahoo function should be 'pageResults =
More information about the Python-list