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

Jason Manning
Jason Manning
417 Points

hows_the_parrot():

I can't get the function that I created to work in the shell.

def hows_the_parrot(): print("He's pining for the fjords!")

hows_the_parrot()

= my function (as in exercise, in file called functions.py)

when I go into the shell and Type:

python functions.py

it doesn't complete the function for me... It just brings up a new like of "treehouse:~/workspace (without an error message)

Am I doing something wrong?

3 Answers

Daniel Ducas-Viramontes
Daniel Ducas-Viramontes
2,879 Points

Hi guys before you execute your file make sure your out of the python shell if you see >>> then your still in the python shell get out by using exit() then after execute your file functions.py in the console Not in the python Shell. like this: treehouse:~/workspace$ python functions.py

Jason Manning
Jason Manning
417 Points

I failed to save it before running it. My bad!

I'm having the same issue even after I saved the file. I can't figure out what's going on here.