当前位置:网站首页>A useless confession artifact
A useless confession artifact
2022-04-23 20:20:00 【Install a sound 77】
python Simple GUI, be based on tkinter Library establishment , just 100 Unreachable code , Add a picture
About packing exe Words Use pyinstaller stay cmd In the middle of
When dubbing taller -F -w XXXX.py
from tkinter import *
from PIL import ImageTk, Image
from tkinter import messagebox
import random
def closeWindow():
messagebox.showinfo(title=' Warning ',message=' Net layout , Please answer carefully !')
return
def nolove():
no_love=Toplevel(window)
no_love.title(' Don't worry !')
no_love.geometry('300x100+580+290')
lable=Label(no_love,text=' It's also called a message loop ',font=(' Microsoft YaHei ',20))
lable.pack()
btn=Button(no_love,text=' ok ',width=10,height=2,command=no_love.destroy)
btn.pack()
no_love.protocol("WM_DELETE_WINDOW",close_nolove)
def close_nolove():
no_love=Toplevel(window)
no_love.title(' Don't worry !')
i=random.randint(10,90)
no_love.geometry('300x100+5'+str(i)+'+290')
lable=Label(no_love,text=' It's also called a message loop ',font=(' Microsoft YaHei ',20))
lable.pack()
btn=Button(no_love,text=' ok ',width=10,height=2,command=no_love.destroy,bg='red')
btn.pack()
no_love.protocol("WM_DELETE_WINDOW",close_nolove)
def love():
love=Toplevel(window)
love.title(' Hey ')
love.geometry('300x100+580+290')
lable = Label(love, text=' What a coincidence. Me too !', font=(' Microsoft YaHei ', 20))
lable.pack()
btn3=Button(love,text=' agree! ',width=10,height=2,command=closelove)
btn3.pack()
love.protocol("WM_DELETE_WINDOW", lovecloseno)
def closelove():
window.destroy()
def lovecloseno():
pass
# create a window
window = Tk()
# Set the window title
window.title(" From the lonely, weak and helpless students ")
# Set window size
window.geometry("385x385")
# window position
window.geometry("+456+169")
# The window cannot be closed
window.protocol("WM_DELETE_WINDOW", closeWindow)
btn1 = Button(window, text=" like ", width=15, height=2,command=love)
btn1.grid(row=3, column=0, sticky=W)
btn2 = Button(window, text=" however , I decline ",command=nolove)
btn2.grid(row=3, column=1, sticky=E)
# Label control
label1 = Label(window,text = "hello, Cute girl " ,font = (' Microsoft YaHei ', 15),fg='red')
# location grid( The window can't be closed )
label1.grid(row = 0,column = 0,sticky=W)
label2 = Label(window,text = " Don't shut it down ?!" ,font = (' Microsoft YaHei ', 35))
# sticky Alignment method NSWE( bearing )
label2.grid(row = 1,column = 1,sticky=E)
img = Image.open('./love.jpg')
photo = ImageTk.PhotoImage(img)
imageLable = Label(window, image=photo)
# columspan Number of columns the component spans
imageLable.grid(row=2, columnspan=2)
# Display window Message loop
window.mainloop()
design sketch
版权声明
本文为[Install a sound 77]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210551491694.html
边栏推荐
- DTMF dual tone multi frequency signal simulation demonstration system
- [graph theory brush question-4] force deduction 778 Swimming in a rising pool
- 微信中金财富高端专区安全吗,证券如何开户呢
- Cadence Orcad Capture CIS更换元器件之Link Database 功能介绍图文教程及视频演示
- nc基础用法3
- Browser - learning notes
- Leetcode dynamic planning training camp (1-5 days)
- WordPress插件:WP-China-Yes解决国内访问官网慢的方法
- Remote code execution in Win 11 using wpad / PAC and JScript 3
- PIP installation package reports an error. Could not find a version that satisfies the requirement pymysql (from versions: none)
猜你喜欢
Commit and ROLLBACK in DCL of 16mysql
Grafana shares links with variable parameters
Building the tide, building the foundation and winning the future -- the successful holding of zdns Partner Conference
Don't bother tensorflow learning notes (10-12) -- Constructing a simple neural network and its visualization
[target tracking] pedestrian attitude recognition based on frame difference method combined with Kalman filter, with matlab code
[text classification cases] (4) RNN and LSTM film evaluation Tendency Classification, with tensorflow complete code attached
How to protect ECs from hacker attacks?
Numpy Index & slice & iteration
Sqoop imports tinyint type fields to boolean type
Livego + ffmpeg + RTMP + flvjs to realize live video
随机推荐
Mysql database - connection query
Solution to PowerDesigner's failure to connect to MySQL in x64 system
SIGIR'22 "Microsoft" CTR estimation: using context information to promote feature representation learning
Fundamentals of network communication (LAN, Wan, IP address, port number, protocol, encapsulation and distribution)
Redis installation (centos7 command line installation)
Cadence Orcad Capture CIS更换元器件之Link Database 功能介绍图文教程及视频演示
JDBC tool class jdbcfiledateutil uploads files and date format conversion, including the latest, simplest and easiest way to upload single files and multiple files
NC basic usage 1
NC basic usage 4
Introduction to electron tutorial 3 - process communication
Redis distributed lock
nc基础用法3
中金财富公司怎么样,开户安全吗
Design of warehouse management database system
[2022] regard 3D target detection as sequence prediction - point2seq: detecting 3D objects as sequences
R语言使用econocharts包创建微观经济或宏观经济图、indifference函数可视化无差异曲线、自定义计算交叉点、自定义配置indifference函数的参数丰富可视化效果
Introduction to electron Tutorial 4 - switching application topics
PCA based geometric feature calculation of PCL point cloud processing (52)
还在用 ListView?使用 AnimatedList 让列表元素动起来
Servlet learning notes