What is the python command in Linux?
In Linux, you can use the python
command to run a Python script or enter the interactive Python shell. For example, to run a script named my_script.py
, you would use the following command:
python my_script.py
To enter the interactive Python shell, simply run the python
command without any arguments:
python
Once in the shell, you can enter Python code and it will be executed immediately. You can exit the interactive shell by typing the exit()
command or pressing CTRL + D
.