shell - Run Python in Android Terminal -


i have android 5.1 cm12 (rooted, supersu, busybox) , try access python android (pythonforandroid_r5.apk) android terminal.

i have followed tutorial: http://lifepluslinux.blogspot.de/2015/01/installing-python-on-android-50.html

this script use (python2):

    export external_storage=/mnt/sdcard      pythonpath=${external_storage}/com.googlecode.pythonforandroid/extras/python     pythonpath=${pythonpath}:/data/data/com.googlecode.pythonforandroid/files/python/lib/python2.6/lib-dynload     export pythonpath     export temp=${external_storage}/com.googlecode.pythonforandroid/extras/python/tmp     export python_egg_cache=$temp     export pythonhome=/data/data/com.googlecode.pythonforandroid/files/python     export ld_library_path=/data/data/com.googlecode.pythonforandroid/files/python/lib /data/data/com.googlecode.pythonforandroid/files/python/bin/python "$@" 

python2 , sh located in system/bin/

but when execute these script get:

c:\users\bla>adb shell python2 : not found/python2[2]: : not identifier: export: pythonpath 

what tell me error! , how fix it?

i have played around while , got work. script (python2 located in system/bin):

export external_storage=/mnt/sdcard export pythonpath=/mnt/sdcard/com.googlecode.pythonforandroid/extras/python:/data/data/com.googlecode.pythonforandroid/files/python/lib/python2.6/lib-dynload:/data/data/com.googlecode.pythonforandroid/files/python/lib/python2.6 export temp=/mnt/sdcard/com.googlecode.pythonforandroid/extras/python/tmp export python_egg_cache=$temp export pythonhome=/data/data/com.googlecode.pythonforandroid/files/python export ld_library_path=$ld_library_path:/data/data/com.googlecode.pythonforandroid/files/python/lib:/data/data/com.googlecode.pythonforandroid/files/python/lib/python2.6/lib-dynload:/mnt/sdcard/com.googlecode.pythonforandroid/extras/python /data/data/com.googlecode.pythonforandroid/files/python/bin/python "$@" 

on android terminal:

u0_a101@c1905:/ $ su root@c1905:/ # python2 

now work include python2.7 in android 5.1 terminal!

dlopen libpython2.6.so python 2.6.2 (r262:71600, mar 20 2011, 16:54:21) [gcc 4.4.3] on linux-armv7l type "help", "copyright", "credits" or "license" more information. >>> print ";)" ;) >>> exit() root@c1905:/ # 

hope someone


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -