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

Can't get script to work in console

At the very first video I cannot get my console to run the script Hello world - python hello.py

I get the error msg "syntax error near unexpected token 'python'

Any ideas?

4 Answers

David Bouchare
David Bouchare
9,224 Points

Which console are you using? Treehouse's workspace or your own terminal?

Also, have you tried typing 'python' in a terminal and run the hello world code?

The Treehouse workspace.

David Bouchare
David Bouchare
9,224 Points

OK, and you have created a file called hello.py with the following code in it (or slightly similar):

print("hello, world")

Yes - I actually just got it to work, don't know how :)

Thanks!