What Is the Python Interpreter?

The Python interpreter runs the text commands you enter into the Python shell and spits out the appropriate response. This is useful for quickly trying new things out. When you download the latest version of Python, you will be able to open the Python shell and interpreter by using your operating system’s terminal (i.e. command line). On Windows, press Window + R, type cmd, and hit enter to open the terminal. Then, type python and hit enter to run the Python interpreter.

Once you’ve got the Python interpreter (shell) open, you’ll be able to run single statements and get immediate results. For example, you could type the expression 5+5, hit enter, and get the result 10 all within the Python interpreter.

Python Command Line Tools to Know

Python Command Line Tools to Know

There are a few useful commands that can help you navigate the Python terminal while you’re trying out simple Python code and possibly Python scripts. Simply type help() and hit enter in the Python interpreter to bring up help functionality. Once you’ve familiarized yourself with what you can do, return to the Python prompt by hitting q.

Need to leave the interactive shell? Press Ctrl-Z and hit enter on Windows. Press Crtl-D and hit enter on Linux and OS X. If you’re not a fan of keyboard shortcuts or you forget these ones, you can always type exit() and hit enter to return to the console.

Keyboard Shortcuts

  • Press q to exit the help functionality
  • Press Ctrl-Z to exit the Python shell (Windows)
  • Press Ctrl-D to exit the Python shell (Linux and OS X)

Learn Python-Centered Software Engineering

If you’re interested in learning more about Python and how to use it for software engineering, then check out Hackbright’s 5-week Prep course. You’ll learn fundamentals of programming and Python, including best practices for the Python shell, interpreter, and scripts.

Recommended Reading

What Can I Do with Python? Tips and Tricks

Is a Python Bootcamp Worth It?

Software Engineers Get Real About Imposter Syndrome

What Is the Python Interpreter?

[easy-social-share buttons="facebook,twitter,mail" counters=1 counter_pos="inside" total_counter_pos="hidden" fixedwidth_px="70" fixedwidth_align="left" total_counter_pos="right" style="button" template="copy-retina" point_type="simple"]
January 09, 2023
What is Pair Programming?
December 19, 2022
Gift Ideas for Computer Programmers
November 05, 2022
Programming Languages: Popularity, Does It Matter?
October 03, 2022
How I Got My Job Panel: With Nura Renke, Devon Jones, and Mehayla Cheadle