Download python> python-for-android
(Ps: do not build your own wheels)
Decompress and copy
Note:
The FAT file system is not supported, so if the SD card is a FAT system, it cannot be executed.
[Html]
<Span style = "font-family: 'Microsoft yahei'; background-color: rgb (0, 0, 0);"> <span style = "font-size: 12px; color: #006600; "> chmod 0755 python </span>
If condition 1 is not true, you can place it in the/data directory.
Modify
Cd to the bin directory
[Html]
<Pre name = "code" class = "html"> chmod 4755 python
Modify bash. bashrc or other
[Html]
<Pre name = "code" class = "html"> export PYTHONHOME = "/data/local/python"
Export PYTHONPATH =.: $ PYTHONHOME/libs: $ PYTHONHOME/lib: $ PYTHONHOME/libs/site-packages: $ PYTHONHOME/lib/python2.6/lib-dynload
Export PATH = $ PYTHONHOME: $ PYTHONPATH: $ PATH
Export LD_LIBRARY_PATH =.: $ PYTHONHOME/lib: $ LD_LIBRARY_PATH
Add to Terminal
Open the terminal-> preferences-> command line, and add
[Html]
<Pre name = "code" class = "html">./data/local/bash. bashrc
(Note the space between. And/data)
This depends on the file name and directory. The G1 ROM of this version does not seem to have a source.
LINK
I forgot how to solve the library dependency problem last time, and then solved it with ln this time.
If
[Html]
'Import site' failed; use-v for traceback
This is required.
[Html]
Ln-s/system/lib/libpython2.6.so/data/local/python/lib/libpython2.6.so
Ln-s/system/lib/libffi. so/data/local/python/lib/libffi. so
TEST
[Python]
<Pre name = "code" class = "html"> # python
>>> Import sys
>>> Sys. path
Author: gmszone