我可以使用 Python 编写原生 iPhone、Android、Windows、Blackberry 应用程序吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16382246/
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 22:26:33  来源:igfitidea点击:

Can I write native iPhone, Android, Windows, Blackberry apps using Python?

androidpythoniosblackberrywindows-mobile

提问by ParasDevD

Is possible to develop Android and iOS mobile applications in Python? I am a newcomer in mobile applications and want to develop mobile applications in Python.

可以用 Python 开发 Android 和 iOS 移动应用程序吗?我是移动应用的新手,想用 Python 开发移动应用。

回答by Nishant Tyagi

Yes you can use kivy

是的,你可以使用kivy

This is a nice cross platform python frameworkwhich works for Android, Win7, Linux, Mac. iOS is possibile but very trivial as Apple doesn't allow scripting.

这是一个很好的跨平台 python 框架,适用于 Android、Win7、Linux、Mac。iOS 是可能的,但非常微不足道,因为 Apple 不允许编写脚本。

And for Android Google provides something called ASE(Android Scripting Environment) which allows scripting languages (Python included) to run on Android. More details here

对于 Android,Google 提供了一种叫做ASE(Android 脚本环境)的东西,它允许脚本语言(包括 Python)在 Android 上运行。更多细节在这里

For iOS Python development would be to embed a Python interpreter into you app and distribute your Python script with it (so to play nicely with Apple rules). In this case your Python application would be a Python interpreter which is packaged with your script and runs it automatically. As I've said - it ain't pretty You can check details Here

对于 iOS,Python 开发是将 Python 解释器嵌入到您的应用程序中并用它分发您的 Python 脚本(以便很好地遵守 Apple 规则)。在这种情况下,您的 Python 应用程序将是一个 Python 解释器,它与您的脚本打包在一起并自动运行。正如我所说 - 它不漂亮你可以在这里查看详细信息

Hope it helps you.

希望对你有帮助。

回答by Herman

Not out of the box. The final product needs to be compiled (iOS) or in bytecode (Android). Since it may be possible to convert Python code to Objective-C or something in between it might be possible.

不是开箱即用的。最终产品需要编译(iOS)或字节码(Android)。由于可以将 Python 代码转换为 Objective-C 或介于两者之间的代码。

See Kivy— the previous threadreferenced it. This allows you to write you app in Python but probably uses a common wrapper (that Kivy provides) to run Python.

请参阅Kivy— 上一个线程引用了它。这允许您用 Python 编写应用程序,但可能使用通用包装器(Kivy 提供)来运行 Python。

Please note that code written in Objective-C (iOS) or Java (Android) will always be faster than middle-ware like Kivy or Phonegap. Unless the one developing is very bad at writing any of those native languages....

请注意,用 Objective-C (iOS) 或 Java (Android) 编写的代码总是比 Kivy 或 Phonegap 等中间件更快。除非开发者不擅长编写任何一种母语......