当前位置: 首页 > news >正文

Python生日系统

#免费源码见文末公众号#

 

录入生日 

def write():key=var1.get()value=var2.get()with open('d:\\生日系统.pickle','rb') as file:dicts=pickle.load(file)dicts[key]=valuewith open('d:\\生日系统.pickle','wb') as file:pickle.dump(dicts,file)file.close()

查询生日 

def read():name=var3.get()with open('d:\\生日系统.pickle','rb') as file:dicts=pickle.load(file)file.close()if name in dicts and dicts[name]!='':re=dicts[name]else:re='ERROR!'t.delete(1.0,tk.END)t.insert('end',re)

删除生日 

def delete():name=var4.get()with open('d:\\生日系统.pickle','rb') as file:dicts=pickle.load(file)file.close()if name in dicts:del dicts[name]else:passwith open('d:\\生日系统.pickle','wb') as file:pickle.dump(dicts,file)file.close()

界面设计 

tk.Label(root,text='欢迎进入生日系统',font=('宋体',12),bg='blue',fg='white',width=20,height=3).place(x=160,y=20)
tk.Label(root,text='姓名',font=('宋体',12),bg='white',fg='black').place(x=20,y=100)
tk.Label(root,text='生日',font=('宋体',12),bg='white',fg='black').place(x=240,y=100)
tk.Label(root,text='姓名',font=('宋体',12),bg='white',fg='black').place(x=20,y=170)
tk.Label(root,text='生日',font=('宋体',12),bg='white',fg='black').place(x=240,y=170)
tk.Entry(root,textvariable=var1).place(x=80,y=100)
tk.Entry(root,textvariable=var2).place(x=300,y=100)
tk.Entry(root,textvariable=var3).place(x=80,y=170)
tk.Entry(root,textvariable=var4).place(x=150,y=240)
t=tk.Text(root,font=('宋体',12),bg='white',fg='black',width=20,height=1)
t.place(x=290,y=170)
tk.Button(root,text='录入',font=('宋体',12),bg='red',fg='white',command=write).place(x=220,y=130)
tk.Button(root,text='查询',font=('宋体',12),bg='yellow',fg='white',command=read).place(x=220,y=200)
tk.Button(root,text='删除',font=('宋体',12),bg='black',fg='white',command=delete).place(x=300,y=235)
http://www.lryc.cn/news/12257.html

相关文章:

  • < CSDN周赛解析:第 28 期 >
  • 【题外话】如何拯救小米11Pro这款工业垃圾
  • Python中有哪些常用操作?这20个你都会吗
  • 【LeetCode】剑指 Offer(4)
  • 庄懂的TA笔记(十二)<>
  • 学分绩点(2023寒假每日一题 5)
  • Framework学习之旅:Zygote进程
  • HTTP基础知识
  • Delphi 10.4.2使用传统代码提示方案(auto complete)(转)
  • 存储类别、链接与内存管理(三)
  • Java:Linux(CentOS)安装、配置及相关命令
  • Linux 操作系统原理 — 多任务优先级调度策略
  • 链表学习之找到两个链表相交的第一个节点
  • 【Kubernetes】【十一】Pod详解 Pod的生命周期
  • Connext DDS录制服务 Recording Service(1)
  • vTESTstudio - VT System CAPL Functions - VT2004(续2)
  • 每天一个linux命令---awk
  • Open3D 点云旋转之轴角式(Python版本)
  • Error: Timeout trying to fetch resolutions from npm
  • Python基础3
  • 高可用集群(HAC)
  • python基于django微信小程序的适老化老人健康预警小程序
  • 基于微信小程序图书馆管理系统
  • 将镭神C32激光雷达的PointXYZ数据转化为PointXYZIR格式 - 附代码
  • 高级前端一面面试题集锦
  • Java基础 -- List集合
  • 【Linux】网络编程 - Socket套接字/基于UDP的网络通信
  • 流程引擎之Camunda简介
  • Mybatis笔记整理
  • 【react全家桶】面向组件编程