We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5843e21 commit c34f38cCopy full SHA for c34f38c
codes/card_manage/cards_main.py
@@ -0,0 +1,35 @@
1
+# 无限循环,由用户决定何时结束
2
+import cards_tools
3
+while True:
4
+
5
+ # 显示功能菜单
6
+ cards_tools.show_menu()
7
8
+ action_str = input("请选择希望执行的操作:")
9
+ print("您选择的操作是 【%s】" % action_str)
10
11
+ # 1,2,3 针对名片的操作
12
+ if action_str in ["1", "2", "3"]:
13
+ # 如果在程序开发时,不希望立刻编写分支内部的代码
14
+ # 可以使用 pass 关键字,表示一个占位符,能够保证程序结构正确!
15
+ # 程序运行时,pass 关键字不会执行任何的操作
16
17
+ # 新增名片
18
+ if action_str == "1":
19
+ cards_tools.new_card()
20
+ # 显示全部
21
+ elif action_str == "2":
22
+ cards_tools.show_all()
23
+ # 查询名片
24
+ else:
25
+ cards_tools.search_card()
26
+ # 0 退出系统
27
+ elif action_str == "0":
28
+ print("-" * 50)
29
+ print("退出系统")
30
+ print("欢迎再次使用【名片管理系统】")
31
+ # pass
32
+ break
33
+ # 其他内容输入错误,提示用户
34
35
+ print("您输入的不正确,请重新选择")
0 commit comments