在Android上使用python和matplotlib [英] Using python and matplotlib on android

查看:403
本文介绍了在Android上使用python和matplotlib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在Android平板电脑上设置python 2.7.x + matplotlib,以便您可以运行简单的标准python代码?我希望能够运行与在Linux桌面上运行的脚本相同的脚本.这仅供我自己使用,不需要将代码分发给其他任何人.

Is there a way to set up python 2.7.x + matplotlib on an android tablet so that you can run simple standard python code? I would like to be able to run the same scripts I run on my Linux desktop. This is just for my own use and I don't need to distribute the code to anyone else.

作为一个具体示例,是否可以运行此脚本?

As a concrete example, is it possible to run this script?

import numpy as np
import matplotlib.pyplot as plt

x = np.arange(0, 5, 0.1);
y = np.sin(x)
plt.plot(x, y)

推荐答案

很简单,不.

可以做到吗?是的.我相信熟练的Python/Android开发人员可以在2到8个小时的工作中完成此任务.这是一个罕见而复杂的请求.

Can it be done? Yes. I believe a skilled Python / Android developer could do it in 2 to 8 hours of effort.. It's a rare and complex request.

为什么我认为可以做到?此示例: http://matplotlib.org/examples/pylab_examples/webapp_demo.html

Why do I think it can be done? This sample: http://matplotlib.org/examples/pylab_examples/webapp_demo.html

使用一个不同的库,并且在没有实时硬件的情况下没有对数据进行抽象,该示例向我展示了SL4A可以执行基于Web的图形: http://www.smartphonedaq.com/android-python-ecg.page

Using a different library, and not abstracted for data without live hardware, this sample shows me that SL4A can do web-based graphics: http://www.smartphonedaq.com/android-python-ecg.page

现在,如果您正在谈论Android中的本机GUI图形-那么我将注意力集中在使用SL4A进行发布的Web方法上;)

Now, if you were talking native GUI graphics in Android - then I'm focused way too much on the web methods of publishing with SL4A ;)

这篇关于在Android上使用python和matplotlib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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