How to Install Python on Termux

How to Install Python on Termux to Run Scripts

How to install python on termux is very easy to practice even by someone who is just learning the termux application though. Just enter the command and everything is right away.

Python is a programming language and is often used in writing scripts or tools. There are 3 versions, namely python, python2 and python3.

Why should install python in termux?

As we know, there are many scripts on github that use the python language. So to run it we have to install python.

For example the darkfb script (hack facebook). This tool uses the python2 language, can be seen in the main file ending in .py and writing is classified as version 2.

What is the difference between python, python2 and python3 ?

A very striking difference is the use of syntax.

This syntax is like punctuation. Example: () ” ‘

python: writing print must use ‘ (one quote) and () brackets.

Example: print(‘python’)

Python2: writing using ” (double quotes) and () less or only “.

Example: print(“this is python2”) / print “this is python2”

Python3: Writing must always use ” and ()

Example: print(“this is python3)

OK, now let’s go straight to the installation method in the termux application.

Here’s a guide to install python on termux

1. Open the termux application and wait for the repository installation process

When we install the termux application for the first time, there will be a repository installation process.

This process is indicated by the writing installation with a white background. Just let it finish on its own. Approximately 1-2 minutes depending on the speed of the internet connection.

2. Enter the command to install the package

In termux, python is a package. And to install the python package we can use the following command:

pkg install python

Then just wait until the installation process is complete.

Notes:
How to install python2 and python3 the same. Just add pkg install in front.

3. Check the installation results

Just write in termux:

python

Then press enter.

If it looks like the image below, it means it worked.

How to install python on termux

Likewise for python2 and python3. Type python2/python3 then hit enter.

Please write a python code in this mode.

Example:

print ('hay saya Arief dari omcyber')

After pressing enter, what comes out is a sentence hi i’m Arief from omcyber.

Well, until here we have successfully installed python in termux. Then you just have to explore for yourself to use it.

To run the script, you can use the following command:

python nama script ( python spam.py )

Alright, let’s talk about it here first. Hopefully it’s useful.

Don’t forget to share this article on social media to make it more useful, of course. Thanks for reading.

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *