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) Python for Beginners Third Quiz

Indra Bergmans
Indra Bergmans
2,199 Points

Python basics question.

Hello,

I was asked the question: 'I have a script named hello_treehouse.py. How would I run this?'

I'm probably overthinking it, but I can't seem to figure it out. Any help please?

3 Answers

Shaun Dixon
Shaun Dixon
10,944 Points

If you think about it you need to tell the terminal/command prompt what to do when running the hello_treehouse.py file. So you would have to prefix the name of the file with the command python so it knows to run this with the python interpreter.

So:

python hello_treehouse.py

should run the file.

Amit Rathod
PLUS
Amit Rathod
Courses Plus Student 694 Points

from terminal as below: $ python hell_treehouse.py

Indra Bergmans
Indra Bergmans
2,199 Points

I knew it would be obvious. Thank you for your answers. It much appreciated!