如何调用来自Android的Python脚本 [英] How to call Python script from Android

查看:475
本文介绍了如何调用来自Android的Python脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在Android中调用Python脚本?我有在Python 2.7已经有一些剧本,我想提醒的是安卓(该脚本创建文件,并填充数据)。为了更具体的我想在手机上执行Python脚本,该脚本连接到一些网站,下载数据,并做一些情报,然后创建新的数据文件(JSON的电话)。

Is it possible in Android to call Python script? I have already some scripts in Python 2.7 and I want to call that from Android(that script create file and fills with data). To be more specific I am trying to execute Python script on phone, that script connects to some site, download data and do some intelligence and then create file with new data(json on phone).

推荐答案

通过Google的 SL4A - 项目,它可能具有的Python脚本,在Android手机上运行。

With googles SL4A-project, it's possible to have Python-scripts execute on your Android phone.

在Android API的零部件都包裹的Python(但不是全部)

Parts of the Android API are wrapped for Python (but not all of it)

您可以<一href="http://$c$c.google.com/p/android-scripting/wiki/FAQ#Can_I_use_SL4A_to_write_a_real_Android_application_or_embed_SL4A">embed Python的脚本在您的应用程序(听起来像你的方法)。

You can embed Python-scripts in your application (sounds like your approach).

这篇关于如何调用来自Android的Python脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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