March 09, 2021 - by Hackbright

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?


see all