如何通过亚行shell中运行QPython [英] How to run QPython over adb shell

查看:695
本文介绍了如何通过亚行shell中运行QPython的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装我的(源于)手机上的QPython。我有麻烦,但是,运行在亚行外壳(busybox的)蟒蛇二进制文件。

I installed the QPython on my (rooted) phone. I'm having trouble, however, running the python binary over the adb shell (busybox).

我可以在设置后运行蟒蛇二进制文件:

I can run the python binary after setting:

export LD_LIBRARY_PATH=/vendor/lib:/system/lib:/data/data/com.hipipal.qpyplus/files

但是,我不能,甚至设置$ PYTHONPATH标准库导入任何模块

However, I cannot import any module from the standard library even setting $PYTHONPATH

export PYTHONPATH=/data/data/com.hipipal.qpyplus/files/lib/python2.7/site-packages

我发现一个忠告,如何在不同终端上的社区维基(的 http://wiki.qpython.org/hacker/#how-to-execute-qpythons-python-in-other-terminals ),我甩enviromnent而在亚行外壳装好了,加载的蟒蛇仍无法加载来自标准库的库,例如随机的。

I found a piece of advice how to run QPython in different terminal on the community wiki ( http://wiki.qpython.org/hacker/#how-to-execute-qpythons-python-in-other-terminals ), and I dumped the enviromnent and loaded it in the adb shell, the loaded python still could not load any libraries from standard library, like random.

从QPython控制台加载标准库工作得很好。任何指针?

Loading standard libraries from QPython console works just fine. Any pointers?

推荐答案

我有蟒蛇按照提供的链接,的http://wiki.qpython.org/hacker/#how-to-execute-qpythons-python-in-other-terminals, prepending脚本中的所有行具有导出,然后以root身份运行 /sdcard/qpyenv.sh。 。最后,我可以运行蟒蛇导入OS ,并在顶部的所有报警消失了。

I got python to work by following the provided link, http://wiki.qpython.org/hacker/#how-to-execute-qpythons-python-in-other-terminals, prepending all lines in the script with export, then running as root ". /sdcard/qpyenv.sh". Finally I could run "python" and "import os" and all warning at the top disappeared.

root@trelte:/ # . /sdcard/qpyenv.sh                                            
root@trelte:/ # python
Python 2.7.2 (default, Oct 25 2014, 20:52:15) 
[GCC 4.9 20140827 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>>

这篇关于如何通过亚行shell中运行QPython的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆