def choose_story_E(num): global story_on, chapter_on num = input_handle(num) if num > 0: print 'num' + str(num) story_on = storys[num-1] engine.chooseStory(story_on) print story_on + 'start' visit_story(story_on) elif num == 0: show_options(storys, choose_story_E)
def choose_story(storys): i = 0 output('this is storys:') for story in storys: i += 1 output(str(i)+story, foreGroundColor.SKYBLUE) story_index = inputMsgDispatch(input('Please choose your story:')) while not story_index: story_index = inputMsgDispatch(input('Please choose your story:')) story_index = 0 if story_index < 0 else story_index % len(storys) if not story_index: return print 'OK Come on!' return engine.chooseStory(storys[story_index-1])