#!/usr/bin/python3
# -*- coding: UTF-8 -*-
import tkinter as tk
window = tk.Tk()
window.title("测试窗口")
width = 800
height = 600
g_screenwidth = window.winfo_screenwidth()
g_screenheight = window.winfo_screenheight()
alignstr = '%dx%d+%d+%d' % (width, height, (g_screenwidth-width)/2, (g_screenheight-height)/2)
window.geometry(alignstr)
window.config(bg='white')
window.resizable(0,0)
window.mainloop()
这个Python脚本使用Tkinter库创建了一个基本的测试窗口。窗口大小设定为800x600像素,并居中显示在屏幕上。背景颜色设为白色,且窗口大小不可调整。程序运行后会进入主循环。
1203

被折叠的 条评论
为什么被折叠?



