一个不可错过的Python求爱程序
部分代码如下:import tkinter as tk
import tkinter.messagebox
root = tk.Tk()
root.title('爱心')
root.resizable(0, 0)
root.wm_attributes("-toolwindow", 1)
screenwidth = root.winfo_screenwidth()
screenheight = root.winfo_screenheight()
widths = 300
heights = 100
x = (screenwidth - widths) / 2
y = (screenheight - heights) / 2
root.geometry('%dx%d+%d' % (widths, heights, x, y))
tk.Label(root, text='亲爱的,做我女朋友好吗?', width=37, font=('宋体', 12)).place(x=0, y=10)
def OK():
# 同意按钮...
用户评论