How to use Python For Android in Terminal on all Android OS easily by using updated python.sh script

Hello,everyone.In this post,I am going to share how to use Python For Android in Terminal in the easiest way .This method will work on all Android OS versions .This method has been tested on all OS by me and works successfully.By using this method,you can also run  Python with your desired command name  .Let us proceed to the tutorial.

Tools Required: 

1. Python For Android.apk :  Download Here

2. python.sh file (fixed and updated) :  Download Here

3.Terminal.apk : Download Here

Working Screenshot:screenshot_2016-09-05-11-15-01.png

 

Steps:

1.Download & Install Python For Android app.Open it and install it’s Python library by clicking on “Install ” Button.Internet is required for first time installation.After successful installation of Python library,your screen will be as shown in screenshot below:screenshot_2016-09-03-19-28-48.png

2.Now,copy downloaded python.sh script file to /system/bin folder.Now,change the permission of Python.sh file to 777 in /system/bin folder.

3.Now ,open Terminal and you can easily run Python with the command as shown in Screenshot:

python.sh

screenshot_2016-09-05-11-15-01.png

4.If everything is correct,you will see Python running successfully in Terminal.

5.You can also rename the python.sh file in /system/bin to any name you like & then you can use that name as command for running Python.I have renamed python.sh file to gaurav

screenshot_2016-09-05-11-16-58.png

6.Now,i can run Python in Terminal by using command:

gaurav

screenshot_2016-09-05-11-18-00.png

 

7.In that way,you can run Python with your desired command name.

Thanks: Luiz

Happy Phreaking brothers.

Thanks everyone for reading my post.Thanks to my  friends and family.

Post your questions in Comments.

Advertisements

Fixing python.sh script to run Python in Terminal on all Android OS in an easier way by using  python.sh command or by any custom command

Hello,everyone.Today, I am going to share how to fix my old python.sh script which I had shared on my blog for using Python in Terminal and how to use python.sh command after fixing that.

At first,I would like to thank my friend Luiz who fixed the old python.sh script which I had shared with you all on this blog.

I consider that Python For Android  app and its Python library has been already installed by you.If,you are using my old python.sh script  which you have already copied to /system/bin ,set its permission as 777,and try to run Python in Terminal  with this command: python.sh  ,you will get error as shown in the screenshot:

This error is shown due to an error in first line of python.sh script as shown in screenshot:

#! /bin/sh 

You are able to use Python only by using this command which is long and complex to type:

sh /system/bin/python.sh


*Fixing python.sh  file:

Android executes commands from /system/bin or /system/xbin .So,we need to edit the first line of  python.sh script of /system/bin  directory as shown below in screenshot:

# !/system/bin/sh 

Save the file and check that it’s permission is assigned as 777.

Or,you can download my  fixed python.sh file from below.

Download Here: python.sh

Now,open Terminal app and use this simple command to run Python  as shown in screenshot:

python.sh


You can see Python running successfully on your Terminal.If you get any error,there might be some mistakes.You need to check your all steps carefully.T o run any file in current directory,you need to use this command:

python.sh filename.py


*Customising(Renaming) python.sh command to any desired name 

You can also rename python.sh file of /system/bin directory to whatever name you like . you need to remember that name and use that name as command to run Python.For example,I have renamed python.sh to gaurav as shown in screenshot:

Now,open Terminal app,and use the command gaurav (you use the name whatever you have given to python.sh file) ,you will see Python successfully running with your customised command as shown in screenshot:

You will see Python running successfully if everything is fine.Now,You have successfullychanged/customised python.sh command.You need to use that command every time to run Python.

Thanks everyone for reading this post.If you have any questions or you get any error,please post in Comments.

Using Python in Terminal on Android OS  without Root Access

Hello,everyone.Today,I am going to share how to use Python in Terminal on Android phone without Root Access.This post is made for them who do not use Rooted phone or those who do not want to Root.

I had thought that it would not be possible to use Python in Terminal without Root Access.Python scripts can also be run using Sl4A , but I find using Python in Terminal better as Sl4a has no option of changing directory.Running Python files is easier in Terminal.So,let us proceed to the tutorial.

Tools Required: 

1. Python For Android.apk: Download Here

2.Terminal.apk :  Download Here

3. Python.sh: Download Here

4. Sl4A.apk(optional file): Download Here 
Steps: 

1.Download all of the above files if you do not have.Install Python For Android app. You can also install Sl4A app if you want.

2.Open Python For Android app and click on Install button to install Python library on your phone .Internet is required for first time installation.After successful installation of Python library,your screen should be like as shown in screenshot given below:

3.Now,copy Python.sh file to your internal memory sdcard  as shown in the screenshot.

3.Now,open Terminal app.To run Python,type these carefully as shown in screenshot:

sh  /sdcard/python.sh 

4.If everything is fine,you will see Python successfully running on Terminal.If,you get error as Python.sh file not found,make sure that python.sh is there in internal sdcard(/sdcard ).

5.To run a script file say hello.py of folder scripts in your sdcard(/sdcard/scripts folder) as shown in screenshot:

we need to type the following command carefully to run hello.py file( /sdcard/scripts/hello.py ) as shown in screenshot below :

cd /sdcard/scripts

sh  /sdcard/python.sh   hello.py

6. In this way you can run any Python file present in current directory on Terminal app by using the following command:

sh  /sdcard/Python.sh  filename.py

Now,you can use Python and Python Scripts on all  Android OS without Root Access in the way shown above.Tutorial is complete now.

I hope this tutorial will be useful for many users.Thanks everyone for reading my post.

If you have any questions or you get any error,please contact me by posting your comments.

Share this if you really like it.

©gauravssnl