Python is a simple and powerful programming language that you can run easily on Termux. It works smoothly because Termux gives you a Linux environment on your Android phone. If you want to learn coding, automation, or small scripts, installing Python in Termux is one of the easiest ways to start. Below are the steps to install Python and some basic commands you can try.
Installation & Basic Commands
First, update your Termux packages so everything works perfectly:
pkg update && pkg upgrade -yNow install Python:
pkg install python -yCheck the installed version to confirm everything is fine:
python --versionTo open the Python shell, just type:
pythonYou will see >>> which means Python is ready. Now you can try simple commands like:
print("Hello Termux")To create a Python file, use:
nano test.pyInside the file, write:
print("Welcome to Python in Termux!")Save and run it:
python test.pyTo install extra Python packages, use pip:
pip install requestsTo see all installed packages:
pip list