All     Ethical Hacking     Networking     Programming     OSINT

Python in Termux – Installation & Basic Commands

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 -y

Now install Python:

pkg install python -y

Check the installed version to confirm everything is fine:

python --version

To open the Python shell, just type:

python

You 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.py

Inside the file, write:

print("Welcome to Python in Termux!")

Save and run it:

python test.py

To install extra Python packages, use pip:

pip install requests

To see all installed packages:

pip list