怎么用python在linux下编写菜单

我想用python编写以个菜单,但是多重的菜单应该怎么写?有没高手请教下。
下面是我菜单的框架:

主菜单———————————————————————————-
welcome to install v2 program
=================================================
make a choice from the menu below
0 return to linux
1 view parameter file
2 install basic service
3 install application service

enter choice:
—————————————————————————————–
2中的子菜单:
=================================================
make a choice from the menu below
0 return to main menu
1 install mysql database
2 install postgresql database
3 install web service

enter choice:

—————————————————————————————–
3中的子菜单:
=================================================
make a choice from the menu below
0 return to main menu
1 install i-tvsite service
2 install i-tvcenter service
3 install i-studio service
4 install i-streaming service
5 install i-gateway service

enter choice:
—————————————————————————————–

shell下的框架已经写好了,就是现在公司要求用python编写。我对python不熟悉,刚刚开始学习,希望各位大侠帮帮忙!
不胜感激!

发表评论