Good Morning,everyone.Today,I am going to share how to run Python 2.7 on Android in Terminal.Many of my friends are not able to run Python in Terminal on Android OS v5.0 or later and they have been asking me for help.If you run Python on these OS,you will get PIE(Position Independent Executables) error as shown in screenshot even after placing python file in /system/bin (see screenshot)

https://gauravssnl.files.wordpress.com/2016/08/14030701_1255079864526994_1477574588_n1.jpg?w=324&h=576 https://gauravssnl.files.wordpress.com/2016/08/14011787_1255079974526983_2007037468_n2.jpg?w=324&h=576

Do not worry about this. My trick will certainly help you to run Python 2.7 in Terminal.You just follow all my steps exactly and carefully. So let us start.

Note: Your phone should be rooted.If you do not know about rooting,search on Google.

Tools Required:

1. Python For Android.apk(Python 2.7): Downland Here

2. Terminal.apk: Download Here

3. python.sh script : Download Here

4. Sl4a.apk (optional file): Downlaod Here

Steps:

1. Download and install all of these above applications.

2. Open Python For Android application, Install its library files.Internet is required for first time installation.

3. Move/place python.sh script file which you downloaded to /system/bin as shown in screenshot(see screenshot).

https://gauravssnl.files.wordpress.com/2016/08/screenshot_2016-08-15-10-42-38.png?w=656

4. Now open Terminal and execute these commands in Terminal to run Python as shown in screenshot(see screenshot): sh /system/bin/**python                              

http://gauravssnl.files.wordpress.com/2016/08/screenshot_2016-08-15-10-35-178.png

5. Now,you can see Python running successfully in Terminal on your Android phone.

6. To run any python file bug.py  located in /sdcard , you can type these in Terminal(see screenshot).

http://gauravssnl.files.wordpress.com/2016/08/screenshot_2016-08-15-11-07-073.png

7. Now,everything is working fine.You can use Python in Terminal and as well as in Sl4a Application.

I hope my trick will be useful for them who use Android OS v5.0 or later.This trick can also be used by users who use older Android OS .If you have any questions, doubts or you get any error,please post in comments.Fell free to ask.

Thanks to my family,my friends and Facebook groups where i learn. Thanks for reading this post.

Sharing is caring.Share this post with your friends.

©gauravssnl

Share on: TwitterFacebookEmail


Published

Category

Android, Python

Stay in Touch