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

Python抽奖系统

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

抽奖系统①

def choujiang1():def write():with open('d:\\抽奖系统\\抽奖1.1.pickle','rb') as file:lst1=pickle.load(file)name=var1.get()if name not in lst1 and name!='录入成功!' and name!='录入失败!' and name!='':lst1.append(name)var1.set('录入成功!')else:var1.set('录入失败!')with open('d:\\抽奖系统\\抽奖1.1.pickle','wb') as file:pickle.dump(lst1,file)file.close()with open('d:\\抽奖系统\\抽奖1.2.pickle','rb') as file:lst2=pickle.load(file)gift=var2.get()if gift not in lst2 and gift!='录入成功!' and gift!='录入失败!' and gift !='':lst2.append(gift)var2.set('录入成功!')else:var2.set('录入失败!')with open('d:\\抽奖系统\\抽奖1.2.pickle','wb') as file:pickle.dump(lst2,file)file.close()def choice():with open('d:\\抽奖系统\\抽奖1.1.pickle','rb') as file:lst1=pickle.load(file)with open('d:\\抽奖系统\\抽奖1.2.pickle','rb') as file:lst2=pickle.load(file)names=var3.get()if names in lst1:lst1.remove(names)if len(lst2)==0:var4.set('没有礼物了!')else:t=r.randint(0,len(lst2)-1)var4.set(lst2[t])lst2.remove(lst2[t])else:var4.set('查无此人!') 

抽奖系统②

def choujiang2():lst=[i for i in range(0,100)]   #管理员设置奖品with open('d:\\抽奖系统\\抽奖2.pickle','wb') as file:pickle.dump(lst,file)file.close()def choujiang_2_():with open("d:\\抽奖系统\\抽奖2.pickle",'rb') as file:lst=pickle.load(file)if lst:t=r.randint(0,len(lst)-1)var.set(lst[t])lst.remove(lst[t])with open('d:\\抽奖系统\\抽奖2.pickle','wb') as file:pickle.dump(lst,file)file.close()else:var.set(' 没有奖品了!')

抽奖系统③

def choujiang3():def gifts():global flag1if flag1==1:gift=var2.get()with open('d:\\抽奖系统\\抽奖3.pickle','rb') as file:lst=pickle.load(file)lst.append(gift)file.close()with open('d:\\抽奖系统\\抽奖3.pickle','wb') as file:pickle.dump(lst,file)file.close()else:var2.set('ERROR!')def keys():global flag1key=var1.get()if key==user_keys:flag1=1var1.set('欢迎管理员进入系统!')else:var1.set('管理员密码错误!')def choice():with open('d:\\抽奖系统\\抽奖3.pickle','rb') as file:lst=pickle.load(file)if len(lst)!=0:t=r.randint(0,len(lst)-1)var3.set(lst[t])lst.remove(lst[t])else:var3.set('ERROR!')with open('d:\\抽奖系统\\抽奖3.pickle','wb') as file:pickle.dump(lst,file)file.close()def end():global flag1flag1=0
http://www.lryc.cn/news/12185.html

相关文章:

  • 真实景观渲染技巧【Three.js】
  • MySQL知识汇总:MySQL函数CASE WHEN用法详解
  • Python学习-----模块1.0(模块的简介、定义与使用)
  • Linux进程学习【二】
  • 我问chatGPT,在JavaScript中构造函数和类的区别
  • 软考高级-信息系统管理师之沟通管理(最新版)
  • PyQt5 自定义富文本编辑器
  • 【高可用系统架构设计】SLA服务可用性4个9是什么意思?如何保证服务的高可用性 HA(High Availability)?...
  • 微服务架构设计模式-(14)面向生产环境
  • HTML5新增用法
  • 富足金字塔:人的努力是为了扩大选择的范围
  • C++类基础(十七)
  • LeetCode刷题复盘笔记—一文搞懂贪心算法之56. 合并区间(贪心算法系列第十四篇)
  • Andriod入门级开发
  • DCL 数据控制语言
  • 全网超详细的下载与安装VMware虚拟机以及为什么要安装VMware虚拟机
  • Python获取zabbix问题触发器
  • 原型链污染
  • ClickHouse详解
  • 02_Docker 安装
  • K8S集群将Docker切换到Containerd
  • Kubernetes03:kubernetes 功能和架构
  • LabVIEW中CPU和内存使用情况在NI分布式系统管理器中不可见
  • buu [NPUCTF2020]Classical Cipher 1
  • 分享96个HTML体育竞技模板,总有一款适合您
  • Python pandas「原有或者新建」Excel中「追加新或者新建」sheet
  • 程序员必备的软技能- CPU“没有灵魂的躯体”
  • 基于微信小程序的青少年生理健康知识小助手
  • 【scl】博图程序的导入和导出
  • 【C语言】指针进阶