How can I get the screen size in Tkinter?(怎么才能拿到Tkinter的屏幕尺寸呢?)
问题描述
我想知道是否可以使用Tkinter计算屏幕大小。
我想要这样可以使程序在屏幕中央打开.
推荐答案
import tkinter as tk
root = tk.Tk()
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
这篇关于怎么才能拿到Tkinter的屏幕尺寸呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!