Tkinter到Android翻译 [英] Tkinter to android translation
问题描述
我有一个相对简单的tkinter程序,它仅使用Event,Button和Label对象.我想将其翻译为可在android平台上使用.
I have a relatively simple tkinter program that just uses Event, Button and Label objects. I would like to translate this to be usable on an android platform.
1)我应该使用哪种适用于android的python?QPython,py4a?
1) What python for android should I use? QPython, py4a?
2)在那个平台上,我应该使用什么GUI模块?
2) And on that platform, what GUI module should I use?
我想详细说明为什么您认为最好使用特定的模块或应用程序,因为我刚刚进入android场景并希望进行智能跳转.
I'd like a little bit of detail for why you think a specific module or app would be best, as I'm just getting into the android scene and want to make an intelligent jump.
推荐答案
即使出于本机目的,大多数开发人员也会建议您远离Tkinter.这是一个过时且不直观的库,通常使GUI的创建和维护变得比其所需的难度更大.
Even for native purposes, most developers would advise you keep away from Tkinter. It's a dated and unintuitive library that often makes GUI creation and maintenance harder than it needs to be.
使用Python库开发应用并嵌入Android的主要优势是跨平台支持.这些库通常使您可以轻松地将应用程序移植到许多不同的操作系统.
The main advantage of developing apps using a Python library and embedding in Android is cross-platform support. These libraries will often allow you to port your app with ease to many different operating systems.
我不会回答哪个最佳",因为这是基于StackOverflow范围之外的基于意见的问题,但是我会说(通常)从Kivy移植到android比在其他某些库中更容易(例如Qt).但是把它和一粒盐一起吃.如今,大多数库都提供内置的高级GUI功能,您的选择可能不会在这方面限制您.
I will not answer which is "best" since this is an opinion-based question outside the scope of StackOverflow, however I will say it is (generally) easier to port from Kivy to android than it is in some other libraries (such as Qt). But take this with a grain of salt. Most libraries nowadays offer advanced GUI capabilities built-in, and your choice will likely not limit you in that regard.
无论哪种方式,都没有直接/简单的方法可以将Tkinter项目转换为上述任何一种,并且您可能必须使用最终选择的库来重写它.
Either way, there is no direct/simple way to translate your Tkinter project to any of these, and you will likely have to rewrite it with the library you end up choosing.
我还要补充一点,如果您的意图是仅针对android开发,则大多数人建议您使用本机Android语言(例如Java或Kotlin)进行开发,或建议使用利用此类语言的开发工具.这样可以缩小APK的大小,并可能加快您的应用的运行时间.
I will add that if your intent is developing only for android, most would advise developing in a native Android language, such as Java or Kotlin, or using a development tool which makes use of such languages. This would result in smaller APK sizes and likely faster running times for your app.
这篇关于Tkinter到Android翻译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!