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

Dejan Delev
Dejan Delev
461 Points

different error message

in the video it shows NameError, however what I get is

File "<stdin>", line 1
python hello.py
^
SyntaxError: invalid syntax

Am I doing something wrong or is it normal?

2 Answers

if you type just hello.py into the first one you should see a name error. If you type python hello.py into the second one you'll run the script

>>> hello.py                                                                             
Traceback (most recent call last):                                                       
  File "<stdin>", line 1, in <module>                                                    
NameError: name 'hello' is not defined                                                   
>>>                                                                                      
treehouse:~/workspace$ python hello.py                                                   
Hello, World             

Are you entering the command in the python interpreter? Do you see this:

>>>                                                                                      

or this:

treehouse:~/workspace$

?