当前位置:网站首页>Three level menu applet
Three level menu applet
2022-06-26 03:48:00 【Just call me ah Jie】
Implement a three-level menu , Back off , Quit at any time , You can go back to
menu = {
' Beijing ':{
' haidian ':{
' Wudaokou ':{
'soho':{},
' NetEase ':{},
'google':{}
},
' Zhongguancun ':{
' Iqiyi ':{},
' Car home ':{},
'youku':{},
},
' On the ground ':{
' Baidu ':{},
},
},
' Changping ':{
' Shahe ':{
' The old boy ':{},
' Beihang ':{},
},
' Tiantongyuan ':{},
' Huilongguan ':{},
},
' The rising sun ':{},
' Dongcheng ':{},
},
' Shanghai ':{
' Minhang ':{
" People's Square ":{
' Fried chicken ':{}
}
},
' Zhabei ':{
' Train war ':{
' Ctrip ':{}
}
},
' In the pudong new area ':{},
},
' Shandong ':{},
}
current = menu
gyf=[menu]
while True:
for i in current.keys():
print(i)
a = input('>').strip()
if a == 'b':
current=gyf[-1] # current The last one is to keep the previous menu
if len(gyf) > 1: # Prevent multiple errors when exiting the first level menu
gyf.pop() # After getting the upper menu, delete the last one , At this point, the last one is the upper level menu
elif a in ('q','quit'):
break
elif a not in current:
continue
else:
gyf.append(current) # Put the current menu to the last place every time
current=current[a] # Put subordinate menus in current, In this way, the lower level menu will be printed
边栏推荐
- MySQL addition, deletion, query and modification (primary level)
- WebRTC系列-网络传输之6-Connections裁剪
- USB peripheral driver - Enumeration
- (15)Blender源码分析之闪屏窗口显示菜单功能
- ABP framework Practice Series (I) - Introduction to persistence layer
- Class diagram
- 虚拟化是什么意思?包含哪些技术?与私有云有什么区别?
- Navicat16 wireless trial
- IEDA 突然找不到了compact middle packages
- progress bar
猜你喜欢

ABP framework Practice Series (II) - Introduction to domain layer

Alibaba cloud function computing service one click to build Z-blog personal blog

Classic model - Nin & googlenet

Camera-memory内存泄漏分析(三)

Multimedia elements, audio, video
![[paper notes] supersizing self supervision: learning to grasp from 50K tries and 700 robot hours](/img/fe/f8208747e03133f4a66e73598409d5.png)
[paper notes] supersizing self supervision: learning to grasp from 50K tries and 700 robot hours
![[paper notes] learning to grasp with primitive shaped object policies](/img/59/14d8eef92291cb415a8a1c2e5943e8.png)
[paper notes] learning to grasp with primitive shaped object policies

栖霞消防开展在建工地消防安全培训

Nepal graph learning Chapter 3_ Multithreading completes 6000w+ relational data migration

Non H5 end of uni app, regional setting of status bar on the top of mobile phone
随机推荐
如何解决 Iterative 半监督训练 在 ASR 训练中难以落地的问题丨RTC Dev Meetup
JS to achieve the effect of text marquee
机器学习笔记 - 时间序列的趋势分量
Click event
Popupwindow utility class
How to prepare for a moving wedding
js实现文字跑马灯效果
Partition, column, list
【Appium踩坑】io.appium.uiautomator2.common.exceptions.InvalidArgumentException: ‘capabilities‘ are mand
Uni app custom selection date 1 (September 16, 2021)
MySQL高级篇第一章(linux下安装MySQL)【下】
【Flink】Flink 批处理模式Map端数据聚合 NormalizedKeySorter
2022.6.20-----leetcode.715
Restful API interface design standards and specifications
Android gap animation translate, scale, alpha, rotate
Prism framework
MySQL advanced Chapter 1 (installing MySQL under Linux) [2]
【Flink】Flink源码分析——批处理模式JobGraph的创建
Cloud Computing Foundation -0
MySQL development environment