Use Python on the Android python Terminal

Source: Internet
Author: User

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
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.