Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics Meet Python Variables

i don't know how to make run

I'm having a hard time trying to click run, or make the program run. he mentions to press up in the console but its not working for me

chaou youva
chaou youva
3,400 Points

Hey, to run a python file on the console, you need to enter the keyword 'python' followed by the name of your file for example: python my_file.py and then your code is going to run I hope it was helpful

2 Answers

To run a script in the console, type python filename.py or python3 filename.py.

For example, if I wrote a script and called it add.py, I would run it by typing the following into the console:

python add.py

or

python3 add.py

Pressing the up key in the console gives you the last line you entered there, which wouldn't work if you've just launched the console, as you haven't entered anything yet.

Hope this helps!