如何使用 Python 编写 Android 应用程序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15319018/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-18 19:48:11  来源:igfitidea点击:

How do I program an Android App with Python?

androidpython

提问by Willow

I will be in charge of teaching a small group of middle school students how to program phone applications. After much research I found that Python might be the best way to go.

我将负责教一小群中学生如何编写电话应用程序。经过大量研究,我发现 Python 可能是最好的方法。

I am a website development senior at my university, but I have not used Python before. I understand both ActionScript and Javascript and I think their logic might be beneficial for learning Python. For the web languages I am familiar with writing I use Sublime2, Dreamweaver, or Flash to code them.

我是我大学的一名网站开发大四学生,但我之前没有使用过 Python。我了解 ActionScript 和 Javascript,我认为它们的逻辑可能对学习 Python 有益。对于我熟悉的网络语言,我使用 Sublime2、Dreamweaver 或 Flash 对其进行编码。

So my questions are:

所以我的问题是:

Which program do I use to code Python?
How do I use the code created in Python to work on Android phones?

我使用哪个程序来编写 Python 代码?
如何使用 Python 创建的代码在 Android 手机上运行?

采纳答案by Burhan Khalid

There are many IDEs you can use for Python. You will have to find one that suits what you want to do. The official Python wiki has a large list of IDEsand editorsthat you can use as a starting point.

有许多可用于 Python 的 IDE。你必须找到一个适合你想做的事情。官方 Python wiki 有大量 IDE编辑器列表,您可以将其用作起点。

However, keep in mind when you are teaching a class to not end up teaching the editor, but rather the language/concepts.

但是,请记住,当您教授课程时,不要教编辑器,而是教语言/概念。

For Android, the only supported languages are Java and Kotlin. There is a android-scriptingproject that supports Python, however this is strictly experimental.

对于 Android,唯一支持的语言是 Java 和 Kotlin。有一个支持 Python的android-scripting项目,但这只是实验性的。

回答by John Smith

You can use Android scripting layer.

您可以使用Android 脚本层

回答by user232343

I would suggest you to look at http://kivy.org/#home. It supports android, iphone, etc. Also if you are familliar with javascript as you said you can try great titanium accelerator, or some alternative to develop android app.

我建议你看看http://kivy.org/#home。它支持android、iphone等。另外,如果你像你说的那样熟悉javascript,你可以尝试伟大的钛加速器,或者一些开发android应用程序的替代方法。

回答by wcb98

Old question, I know, but you can also check out pygame subset for androidwhich allows you to convert pygame applications to android.

老问题,我知道,但您也可以查看pygame 的 android 子集,它允许您将 pygame 应用程序转换为 android。

回答by Khanrad

Dr. python is a good ide/editor, but its simple to use. If your using linux, you can install it in the software center. I don't know how to install it on OSX/Windows

Dr. python 是一个很好的ide/editor,但它使用起来很简单。如果您使用的是 linux,您可以在软件中心安装它。我不知道如何在 OSX/Windows 上安装它