From 616e70e13327a14123c9c9da2cb497badb5b8e94 Mon Sep 17 00:00:00 2001 From: hnu202109060103 Date: Thu, 15 Dec 2022 17:35:51 +0800 Subject: [PATCH] =?UTF-8?q?Update=20=E5=AD=A6=E7=94=9F=E7=AE=A1=E7=90=86.p?= =?UTF-8?q?y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 学生管理.py | 76 ++++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 36 deletions(-) diff --git a/学生管理.py b/学生管理.py index 53c1ca2..e3cd4b0 100644 --- a/学生管理.py +++ b/学生管理.py @@ -318,39 +318,43 @@ def del_stu(): break else: print('重新输入姓名') -print(' 你想查询的内容') -print('0.查询全部学生信息') -print('1.通过姓名查找学生信息') -print('2.通过电话查找学生信息') -print('3.根据学号查找学生信息') -print('4.通过姓名/电话/学号查找学生信息') -print('5.通过姓名修改学生信息') -print('6.通过电话修改学生信息') -print('7.添加学生信息') -print('8.更新学生信息') -print('9.删除学生信息') -while True: - x=eval(input('请输入:')) - if x==1: - read_someone_by_name() - elif x==2: - read_someone_by_phone() - elif x==3: - read_stu() - elif x==4: - update_by_name() - elif x==5: - update_by_phone() - elif x==6: - add_stu() - elif x==7: - update_stu() - elif x==0: - read_all_stus() - elif x==8: - del_stu() - elif x==9: - read_stu_by_number() - else: - print('输入错误,重新输入') - \ No newline at end of file +if __name__=="__main__": + while (True): + print(' 你想查询的内容') + print('0.查询全部学生信息') + print('1.通过姓名查找学生信息') + print('2.通过电话查找学生信息') + print('3.根据学号查找学生信息') + print('4.通过姓名/电话/学号查找学生信息') + print('5.通过姓名修改学生信息') + print('6.通过电话修改学生信息') + print('7.添加学生信息') + print('8.更新学生信息') + print('9.删除学生信息') + print("10.结束运行") + x=eval(input('请输入:')) + if(x==10): + break + if x==1: + read_someone_by_name() + elif x==2: + read_someone_by_phone() + elif x==3: + read_stu() + elif x==4: + update_by_name() + elif x==5: + update_by_phone() + elif x==6: + add_stu() + elif x==7: + update_stu() + elif x==0: + read_all_stus() + elif x==8: + del_stu() + elif x==9: + read_stu_by_number() + else: + print('输入错误,重新输入') +