How to Open the Python Terminal in Linux


In this article, we show how to open up the python terminal in linux.

So you can run Python in a linux terminal just as you can by opening up the Python IDLE on your computer. It allows you to run Python code the same way as you'd do in a IDLE.

So Python has evolved now to Python3, this article is specific to the Python3 programming language. It does not Python

To open up a Python terminal in a linux command terminal, type in the following line.

Just typing in, python3, allows us to open up the Python terminal to run Python3 code.

This Python terminal functions just like the Python IDLE that you have downloaded from the official Python website.

Below is an image showing this Python terminal opened up in a linux command terminal.

Python terminal in Linux

So you can see that once we typed in, Python3, we got the Python terminal to be shown.

We then test out this Python terminal.

We type in, 2+2, which gives us the output of 4.

We then create a variable, variable1, and set it equal to "Tom"

We then output the variable, which is "Tom"

To exit the Python terminal, all you have to type is exit() or quit().

You then return back to the user command prompt you were using before.

And this is how to pen the python terminal in linux.

Related Resources

How to Randomly Select From or Shuffle a List in Python

HTML Comment Box is loading comments...