I had another attempt at inputting the code perhaps with the right indentation, 
I still get an error return, but not one that indicates that the code has not 
been read, as you suggested. re:- 
----------------------------------------------------------------------------

Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> from bs4 import BeautifulSoup
>>> with open("ecologicalpyramid.html","r") as ecological_pyramid:
...      soup = BeautifulSoup(ecological_pyramid,"lxml")
... producer_entries = soup.find("ul")
  File "<stdin>", line 3
    producer_entries = soup.find("ul")
                   ^
SyntaxError: invalid syntax
>>>  from bs4 import BeautifulSoup
  File "<stdin>", line 1
    from bs4 import BeautifulSoup
----------------------------------------------------------------------------
If, as you suggest I left a free line after the "with open( etc" line, console 
returns an error, if I leave a free line after the "soup = etc" line which 
comes after, again I get an error return, my only point is that with the above 
input, console return does not seem to infer that soup has not been defined. 
You recommend that I put all the code into a file then run it - how do I do 
that ? I am new to Python, as you might have gathered. 
Thank you for your help.
Yours Simon
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to