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 (2015) Logic in Python Fully Functional

Im having problems with workspace and hows_the_parrot

this is my functions.py def hows_the_parrot(): print("He's been eating all his food recently!")

hows_the_parrot()

When I go into my console I go into python then type in: python functions.py
File "<stdin>", line 1
python functions.py
^
SyntaxError: invalid syntax

Whats the problem here if it looks right to me. Not sure what I'm doing wrong

1 Answer

Rich Zimmerman
Rich Zimmerman
24,063 Points

You may still be in the python REPL?

You want to run "python functions.py" from the actual command line.

If you have a ">>>" at the start of the line, you're still in the python REPL. Just hit ctrl+d and then try running the python file.

Christian Ludwig
Christian Ludwig
346 Points

Thankyou ! I was having the same problem and ctrl+d seemed to fix it.