#! /usr/bin/env python#Version: pyyhon 3.x#Author : Syno''' 1st layer: chinese provinces Anhui 2nd layer: Hefei 3rd layer: Jingkai Area Binghu Area... ...
#! /usr/bin/env python
#Version: pyyhon 3.x
#Author : Syno
'''
1st layer: chinese provinces
Anhui
2nd layer:
Hefei
3rd layer:
Jingkai Area
Binghu Area...
Wuhu...
Jiangsu...
'''
lab = {'china':
{'Shanghai':
{'浦東新區':
['平安鎮','大團鎮'],
'嘉定區':['華新鎮','安亭鎮','黃渡鎮'],
'閔行區':['北橋鎮','新橋鎮']},
'Jiangsu':
{'Najing':
['windows']
,'Wuxi':
['linux','else']}},
'USA':
{'Newyork':
{'dongcheng':['doc文件']
,'xicheng':['pdf文件','excel文件','其他']},
'Califonia':
{'Silicon':['1','2']
,'Losangles':['3','4']}},
'......':'......'}
'''
print(lab)
print(lab['china'])
print(lab['china']['Shanghai'])
print(lab['USA'])
print(lab['USA']['Newyork'])
'''
'''while True:
name =input("china or USA?:")
if 'china' ==name:
print("You Got China!")
elif 'USA' == name:
print("You Got USA!")
elif 'q' == name:
print('Bye~')
break
else:
print('Invalid input! please try again!')
'''
tip = True
while tip:
for i0 in lab:
print('\t',i0)
in_1st = input('where will you go 1st?>>>')
if in_1st in lab:
while tip:
for i1 in lab[in_1st]:
print('\t',i1)
in_2nd = input('where will you go 2nd?>>>')
if in_2nd in lab[in_1st]:
while tip:
for i2 in lab[in_1st][in_2nd]:
print('\t\t',i2)
in_3rd = input('where will you go 3rd?>>>')
if in_3rd in lab[in_1st][in_2nd]:
while tip:
for i3 in lab[in_1st][in_2nd][in_3rd]:
print('\t\t\t',i3)
in_4th = input('layer above or quit?>>>')
if in_4th == 'b':
break
elif in_4th == 'q':
tip = False
if in_3rd == 'b':
break
elif in_3rd == 'q':
tip = False
if in_2nd == 'b':
break
elif in_2nd == 'q':
tip = False
if in_1st == 'q':
tip = False