屏幕上显示Python Tkinter应用程序

编程入门 行业动态 更新时间:2024-10-26 06:31:59
本文介绍了屏幕上显示Python Tkinter应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在我的17英寸显示器上使用Python的Tkinter模块设计了一个应用程序 屏幕.

I have designed an application using the Tkinter module from Python, on my 17" screen.

有没有办法使此应用适合较低分辨率的屏幕?我试图在14英寸的屏幕上运行它,但该应用程序不太适合.

Is there a way to make this app fit on lower resolution screens? I have tried to run it on a 14" screen, and the app doesn`t fit well.

谢谢.

推荐答案

您可以通过以下方式获取屏幕分辨率,然后将其输入到root.geometry中:

You can get the screen resolution then input them in your root.geometry, this way:

from Tkinker import * root = Tk() width, height = root.winfo_screenwidth(), root.winfo_screenheight() root.geometry('%dx%d+0+0' % (width,height)) root.mainloop()

更多推荐

屏幕上显示Python Tkinter应用程序

本文发布于:2023-11-23 14:19:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1621748.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   屏幕上   Python   Tkinter

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!