i have script in python consists of multiple list of functions, , @ every end of list want put function let me return beginning of script , choose list. example:
list = ("1. list of users", "2. list of groups", "3. reset password", "4. create new user", "5. create new group", "6. list kernel drivers", "7. list mounts", "8. mount folder", "9. exit") in list: print(i)
and if choose 1 list opens:
list = "1) show user groups \n2) show user id \n3) show user aliases \n4) add new aliases \n5) change password \n6) back" print print list
a more specific example.
you can use while loop until user explicitly doesnt exits program.
import os def show_users(): print("1) show group user") print("2) go back") = int(input()) if i==1: pass # elif i==2: show_list() def show_list(): print("1) list of users") print("2) exit") = int(input()) if ==1: show_users() elif i==2: exit(0) while true: show_list()
Comments
Post a Comment