[英]How to install extra packages for jython that comes with Android
I have an installation of Android sdk on my machine. 我的机器上安装了Android sdk。 And I am using monkeyrunner to execute a bunch of code.
我正在使用Monkeyrunner执行一堆代码。
Now the problem is I also need py-serial package that comes with CPython in my code (that I am running with Jython). 现在的问题是,我的代码中还需要CPython附带的py-serial软件包(我与Jython一起运行)。 I tried adding
sys.path.append('C:\\\\Python27\\\\lib\\\\site-packages')
to my Jython code so that I can use serial package, but that failed miserably. 我尝试将
sys.path.append('C:\\\\Python27\\\\lib\\\\site-packages')
到我的Jython代码中,以便可以使用串行软件包,但是失败了。
My question is how can I use external CPython packages with Jython that comes with Android sdk install? 我的问题是我如何将外部CPython软件包与Android sdk安装随附的Jython一起使用?
You can use AndroidViewClient/culebra as a drop-in replacement for monkeyrunner. 您可以使用AndroidViewClient /库莱布拉作为一个下拉更换为monkeyrunner。
$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import com.dtmilano.android.viewclient
>>> import serial
>>>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.