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 trialAnzor Gurashvili
890 PointsI can't get text printed out like in the video
I can't get text name printed out like it shows in the video. I type in functions.py i get blank. My function looks like this :
def how_the_bunny():
print ("He's fluffy")
how_the_bunny()
20 Answers
slavster
1,551 PointsHad this same issue. Kenneth doesn't explicitly call this out in the video but you need to save functions.py first. Ran like a charm for me after that.
Alexander Davison
65,469 PointsYour code seems to work in my IDLE (Integrated DevelopMent Environment).
Are you sure you are entering the right command in the Console?
You should type this into the Console
python functions.py
I hope this helps. ~Alex
teki
Courses Plus Student 877 PointsIn the console, have you exited python first before running the script? So first, exit() and then python functions.py
I just made that mistake, not sure if it's the same problem :/
Brandon Hoffman
3,642 PointsThank you!!
Chris Freeman
Treehouse Moderator 68,454 PointsThe issue is you have to use parens to call the function:
def how_the_bunny():
print("Fluffy bunny")
how_the_bunny() # <-- add parens
The code originally posted has the parens, but doesn't match the workspaces snapshot you've shared.
Anzor Gurashvili
890 Pointsi do type command into the console , I don't get output to print out like it shows in the video.
Anzor Gurashvili
890 Pointsnope, still doesn't work
Alexander Davison
65,469 PointsTagging Kara P & Kenneth Love
teki
Courses Plus Student 877 PointsYour code works on my screen as well, so not sure what's wrong. Is the file spelled correctly to match functions.py?
Anzor Gurashvili
890 Pointsyes and ive also used tab to auto-fill it
Alexander Davison
65,469 PointsType pwd
into the Console. Make sure you typed exit()
if you are still in the Python Shell!
What do you see?
Anzor Gurashvili
890 PointsI've been typing exit() function in python shell from the start. When I enter python functions.py shell gives me same entry as if I just pressed enter on empty space.
Alexander Davison
65,469 PointsDude type pwd
in the Console.
Anzor Gurashvili
890 Pointsbash: syntax error near unexpected token `pwd' . Now what ?
Alexander Davison
65,469 PointsUm, it shouldn't cause a Syntax error...
I'm sure sure why your workspace isn't running, but if I were in your situation, I would download your project files so that you got the project stuff all safe, then delete the workspace & create a new one while uploading the files your've downloaded.
If this doesn't work, I'll tag Kenneth Love and/or Chris Freeman.
Zack Thompson
356 Pointsim having the same problem as anzor
Anzor Gurashvili
890 PointsStill doesn't work. I feel like I'm wasting my time and money on teamtreehouse. What's the point if they can't get you being to run simplest form of code.
Alexander Davison
65,469 PointsYeah, pwd
is supposed to be a valid command... Dunno what's wrong... Tagging Kenneth Love and Chris Freeman
Chris Freeman
Treehouse Moderator 68,454 PointsCan you share a link to your workspace?
Anzor Gurashvili
890 Pointshere is the link , thanks https://teamtreehouse.com/workspaces/22594292
Alexander Davison
65,469 PointsRemember; you can never send a link directly to your workspace. The only person who can click onto that link and go to your workspace is yourself. For everybody else it won't work, including myself.
Make a snapshot of your workspace and send that link :)
Anzor Gurashvili
890 Pointsok does this work ? https://w.trhou.se/sryllaitdb
Alexander Davison
65,469 PointsYep it does :)
I'm going to check on it now. I'll reply when I found the error.
Alexander Davison
65,469 PointsAh I see. You are missing the () parens when you are calling the function
Remember: Always put the parentheses when calling the function, even if it takes no arguments!
I hope this helps :)
(Lol I posted this less than 1 minute after the first reply. I found it so quickly )
Anzor Gurashvili
890 Pointsok , other hundred times i wrote this function , I've included parenthesis at the end. It still doesn't work.
Alexander Davison
65,469 PointsYour code works... I checked your workspace...
Anzor Gurashvili
890 Pointsok its working, i think its because i wasn't saving file........
Alexander Davison
65,469 PointsAwesome! Can you give somebody other than yourself a Best Answer? Thanks!
Chris Freeman
Treehouse Moderator 68,454 PointsI recommend Stanislav Sinitsyn for the Win since they first suggested the "save file" solution.
Alexander Davison
65,469 PointsLol 18 answers...
abdellatif zouliga
1,978 Pointsi didn't get the output in the console after trying many times, that is why i used pycharm
garrettkipps
965 PointsCode in the video does not run in workspaces...?