Python Android 上的 PyQt
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18436340/
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
PyQt on Android
提问by cyberbudy
I'm working on PyQt now, and I have to create the application on Android, I've seen the kivy library, but it's too crude.
我现在在做PyQt,必须在Android上创建应用程序,我看过kivy库,但它太粗糙了。
Is there any way now to run an application on Android made on PyQt?
现在有没有办法在 PyQt 上运行 Android 上的应用程序?
采纳答案by Wedava
Android does not support pyQt4. PyQt5 is however supported(read this: https://groups.google.com/forum/#!topic/android-scripting/HUbyuYnm3Z8). However, you could port you application to use PySide(https://pypi.python.org/pypi/PySide). It provides bindings for the Qt4 platform. You can then use pyside-android(http://thp.io/2011/pyside-android/).
安卓不支持pyQt4。但是支持 PyQt5(阅读:https://groups.google.com/forum/#!topic/android-scripting/HUbyuYnm3Z8 )。但是,您可以将应用程序移植到使用 PySide(https://pypi.python.org/pypi/PySide)。它为 Qt4 平台提供绑定。然后您可以使用 pyside-android( http://thp.io/2011/pyside-android/)。
回答by Wedava
With the tool pyqtdeployyou can deploy a PyQt5 app to:
使用pyqtdeploy工具,您可以将 PyQt5 应用程序部署到:
- Windows
- GNU/Linux
- Mac OS X
- Android
- iOS
- 视窗
- GNU/Linux
- Mac OS X
- 安卓
- IOS
Click here to see pyqtdeploy's documentation. It is a GUI tool that will package your PyQt5 application and compile it for the target platform.
单击此处查看 pyqtdeploy 的文档。它是一个 GUI 工具,它将打包您的 PyQt5 应用程序并为目标平台编译它。
It lets you select various Qt modules to include in the compilation:
它允许您选择要包含在编译中的各种 Qt 模块:
On the command-line you would use the pyqtdeploy-build
command like this:
在命令行上,您将使用如下pyqtdeploy-build
命令:
pyqtdeploy-build pyqt-demo.pdy
Back in June 2016, there was a mailing list message that indicated that pyqtdeploy works. It's 2018 as I'm writing this so I assume pyqtdeploy has matured; the latest package version is 2.0.1 which was released on 5 January 2018.
早在 2016 年 6 月,有一个邮件列表消息表明 pyqtdeploy 可以工作。我写这篇文章时是 2018 年,所以我认为 pyqtdeploy 已经成熟;最新的软件包版本是 2018 年 1 月 5 日发布的 2.0.1。