Step 1:
Check if python is installed on your computer, enter python --version to check python2, and enter python3 --version to check python3.
Step 2:
Install geany compiler, geany is a free universal compiler that supports different systems For programming in different languages, enter geany and follow the installation prompt to enter sudo apt-get install geany to install.
Step 3:
Enter geany on the command line to open the compiler
Configure Build-Set Build Commands
Add python2.6 -m py_compile "%f" to Compile in the window below, add python2.6 "%f" after Execute, of course you can also change 2.6 to other, as long as the computer has this version of python
Enter the test line print("hello"), click compile (or shortcut key F9), and run (or shortcut key F5) to see the output result.
Note:
/bin/sh: 1: Python2.6: not found this error appears The reason is that the appropriate suffix is not used when saving the file, as long as the suffix of .py is added.