Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics Meet Python Syntax and Errors

I tried running the print ("Hello, Andrew") on a clean console but kept getting the error bash:syntax error near token

"unexpected token, '"Hello, Andrew"'. Why is it placing a single quotation before my standard quote?

2 Answers

The console in the Workspace is a bash console rather than a python console. To get to the interactive python console, type python or python3 in the console in the Workspace. If instead you want to run the file hello.py from the bash console, type python hello.py in the console.

Okay, so basically when I want to see if I am in a bash console I can try running a new code? I am curious how do I know each time I am in a "bash". This is very helpful, thank you.

In the workspaces, if the command prompt is something like treehouse:~workspace$ (with workspace being the name of the folder), then you are in the bash console. The command prompt for the python console is >>>.

The file needs to be saved first did you do that?

Saving helped.