Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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.