没有合适的资源?快使用搜索试试~ 我知道了~
基于python的学生信息管理系统.pdf
资源推荐
资源详情
资源评论
基于基于python的学⽣信息管理系统的学⽣信息管理系统
基于基于python的学⽣信息管理系统的学⽣信息管理系统
源码源码
"""
Welcome to Python
Life is short , You need python
author: MX_INFO
version: 1.0
"""
import os
#⽂件路径
filename="student.txt"
#主菜单
def mainMenu():
while True:
menu()
choice=int(input("请选择:"))
if choice in range(8):
if choice==0:
answer=input("你确定退出系统吗?y/n")
if answer=='y' or answer=='Y':
print("谢谢你的使⽤")
break
else:
continue
elif choice==1:
insert()
elif choice==2:
search()
elif choice==3:
delete()
elif choice==4:
modify()
elif choice==5:
sort()
elif choice==6:
total()
elif choice==7:
show()
else:
print("你的输⼊有误~~~")
#添加学⽣信息
def insert():
student_lst=[]
while True:
id=input("请输⼊学⽣ID:")
if not id:
break
name=input("请输⼊学⽣姓名:")
if not name:
break
try:
english=int(input("请输⼊英语成绩:"))
java=int(input("请输⼊Java成绩:"))
python=int(input("请输⼊python成绩:"))
except:
print("输⼊⽆效,请重新输⼊~~")
continue
#将录⼊的学⽣信息保存到字典
stu={"id":id,"name":name,"english":english,"java":java,"python":python}
student_lst.append(stu)
answer=input("是否继续添加y/n:")
if answer=='y' or answer=='Y':
continue
else:
break
sava(student_lst)
print("学⽣信息录⼊完毕~~")
#将键盘输⼊信息存⼊磁盘
def sava(lst):
try:
stu_txt=open(filename,"a",encoding="utf-8")
except:
stu_txt = open(filename, "w", encoding="utf-8")
for item in lst:
stu_txt.write(str(item)+"\n")
资源评论
是空空呀
- 粉丝: 168
- 资源: 3万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功