溫馨提示×

python怎么獲取屏幕大小

小億
237
2023-11-23 07:11:44
欄目: 編程語言

您可以使用tkinter庫來獲取屏幕大小。以下是一個示例代碼:

import tkinter as tk

root = tk.Tk()
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()

print("屏幕寬度:", screen_width)
print("屏幕高度:", screen_height)

這將打印出屏幕的寬度和高度。請注意,tkinter庫是Python的內置庫,因此您無需額外安裝即可使用它。

0
亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女