Text Code(from 'Getting Started in Beautiful Soup' re: cd Soup , returns 'Syntax Error, invalid syntax'

Dave Angel davea at davea.name
Thu Dec 11 14:34:55 EST 2014


Please give your environment when starting a new thread.  Python version 
and OS version.  In this case, I'm guessing Windows, because I have to 
guess something to give a meaningful answer.

On 12/11/2014 02:21 PM, Simon Evans wrote:
> At the start of Chapter 3 of 'Getting Started in Beautiful Soup' it has said to create a html file, 'ecological
>
> pyramid.html' - which I have already done re:
>
<snip>
> ----------------------------------------------------------------------------
> and ran it okay in 'Explorer', and text then says to save it to a folder named 'Soup' which I have done.
> On the next page (30) it says to navigate to that folder with the following  code to the python console :-
>
> cd Soup
>
> however console rejects that code with the following return: -
> ----------------------------------------------------------------------------
> 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.
>>>> cd Soup
>    File "<stdin>", line 1
>      cd Soup
>            ^
> SyntaxError: invalid syntax
>>>>

cd is not a Python "command", it's a   cmd command.  In other words, you 
type that in your DOS box before starting Python.


-- 
DaveA



More information about the Python-list mailing list