Dear Peter Otten,
I typed in (and did not copy and paste) the code as you suggested just now
(6.28 pm, Sunday 12th July 2015), this is the result I got:
----------------------------------------------------------------------------
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("C:\Beautiful Soup\ecologicalpyramid.html","r")as f:
... soup = BeautifulSoup(f,"lxml")
File "<stdin>", line 2
soup = BeautifulSoup(f,"lxml")
^
IndentationError: expected an indented block
>>> soup = BeautifulSoup(f,"lxml")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'f' is not defined
>>>
----------------------------------------------------------------------------
The first time I typed in the second line, I got the
"Indentation error"
the second time I typed in exactly the same code, I got the:
"NameError:name 'f' is not defined"
--
https://mail.python.org/mailman/listinfo/python-list
- Why doesn't input code return 'plants' as in ... Simon Evans
- Re: Why doesn't input code return 'plant... Mark Lawrence
- Re: Why doesn't input code return 'plant... Simon Evans
- Re: Why doesn't input code return 'p... Peter Otten
- Re: Why doesn't input code return 'plant... Simon Evans
- Re: Why doesn't input code return 'p... Peter Otten
- Re: Why doesn't input code return 'plant... Simon Evans
- Re: Why doesn't input code return 'plant... Simon Evans
- Re: Why doesn't input code return 'p... Peter Otten
- Re: Why doesn't input code return 'p... Larry Hudson via Python-list
- Re: Why doesn't input code return 'plant... Simon Evans
- Re: Why doesn't input code return 'p... MRAB
- Re: Why doesn't input code return 'p... Mark Lawrence
- Re: Why doesn't input code return 'p... Albert Visser
- Re: Why doesn't input code return 'p... Laura Creighton
- Re: Why doesn't input code retur... Mark Lawrence
- Re: Why doesn't input code r... Laura Creighton
- Re: Why doesn't input c... Mark Lawrence
- Re: Why doesn't input code return 'plant... Laurent Pointal
- Re: Why doesn't input code return 'p... Chris Angelico
